def main():
init_logger()<EOL>args = _parse_cli_args()<EOL>if args.u:<EOL><INDENT>enter_api_key()<EOL>return<EOL><DEDENT>if args.O == GEVENT:<EOL><INDENT>args.O = _gevent_patch()<EOL><DEDENT>set_image_size_mode(args.s)<EOL>photoset_id = args.g<EOL>global directory<EOL>directory = args.d if args.d else photoset_id<EOL>read_config()<EOL>photos = get_photos_info(photoset_id)<EOL>create_dir(directory)<EOL>if args.O == SINGLE_PROCESS:<EOL><INDENT>single_download_photos(photos)<EOL><DEDENT>elif args.O == GEVENT:<EOL><INDENT>event_download_photos(photos)<EOL><DEDENT>elif args.O == MULTITHREAD:<EOL><INDENT>multithread_download_photos(photos)<EOL><DEDENT>else:<EOL><INDENT>logger.error('<STR_LIT>')<EOL><DEDENT>
The main procedure