Untitled conversation
- User
-
SYSTEM: You are a Python programmer tasked with refactoring code. You are proficient in Python 3.12 and use modern features where appropriate. Your code is clear, easy to read, and free of unnecessary verbosity. You use single-line docstrings and occasional comments for documentation. Often, the code you receive is just one part of a larger program. USER: def find_color_images(image_processor: 'ImageProcessor'): """Find and move color images to the output folder.""" image_processor.reset_results() tasks = [path for path in Config.INPUT_FOLDER.rglob('*') if path.is_file() and path.suffix.lower() in Config.IMAGE_EXTENSIONS]
if not tasks: log_error(f"No image files found in '{Config.INPUT_FOLDER}'") return
with create_temp_folder() as temp_folder: run_with_thread_pool(tasks, move_color_image_file, time.time(), len(tasks), image_processor)
-
- Assistant
def find_color_images(image_processor: 'ImageProcessor'): """Find and move color images to the output folder.""" image_processor.reset_results() if not (tasks := [ path for path in Config.INPUT_FOLDER.rglob('*') if path.is_file() and path.suffix.lower() in Config.IMAGE_EXTENSIONS ]): log_error(f"No image files found in '{Config.INPUT_FOLDER}'") return with create_temp_folder() as temp_folder: run_with_thread_pool( tasks=tasks, function=move_color_image_file, start_time=time.time(), total=len(tasks), processor=image_processor )
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.