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