def METHOD_NAME():
    if not os.path.isdir(args.task_cache_dir):
        raise Exception("Please provide a correct task cache dir.")
    try:
        os.makedirs(args.candidate_cache_dir, exist_ok=True)
    except OSError:
        print(f"Directory {args.candidate_cache_dir} cannot be created successfully.")
    task_paths = sorted(glob.glob(os.path.join(args.task_cache_dir, "*.json")))[
        args.file_group * 10 : (args.file_group + 1) * 10
    ]
    print(f"Selected models: {task_paths}")
    for num, task_path in enumerate(task_paths):
        print(f"Processing model {num} ...")
        with open(task_path, "rb") as file:
            tasks = file.readlines()
        model_name = task_path.split("/")[-1][len("relay-") :][: -len("_extracted_tasks.json")]
        os.makedirs(os.path.join(args.candidate_cache_dir, model_name), exist_ok=True)
        for task_str in tqdm(tasks):
            task_name, task_mod = json.loads(task_str)
            task_mod = load_json(json.dumps(task_mod))
            sample_candidates(task_mod, task_name, model_name)