def METHOD_NAME(verify_sizes=True):
    '''Get train, valid, test retro datasets.'''
    args = get_args()
    retro_args = get_retro_args()
    # DB dataset.
    db_dataset = get_db_dataset()
    # Retro datasets.
    chunk_ds_info_map = get_chunk_dataset_map()
    retro_dataset_map = {}
    for data_key, chunk_ds_info in chunk_ds_info_map.items():
        chunk_dataset = chunk_ds_info["data"]
        neighbor_dir = chunk_ds_info["neighbor_dir"]
        neighbor_path_map = BlockPathMap.from_dir(neighbor_dir,
                                                  retro_args.retro_block_size)
        # Verify dataset prefixes.
        expected_dir = get_neighbor_dirname(data_key, chunk_dataset.sample_dataset)
        assert expected_dir == neighbor_dir, \
            "inconsistent dataset source; '%s' vs. '%s'." % \
            (expected_dir, neighbor_dir)
        # Verify num chunks.
        n_sample_chunks = len(chunk_dataset)
        n_neighbor_chunks = neighbor_path_map.max_idx
        if not os.path.isdir(neighbor_dir):
            if torch.distributed.get_rank() == 0:
                raise Exception("neighbor directory '%s' not found; please "
                                "compare --train-samples, --seq-length, --seed, "
                                "--eval-iters, and --eval-interval, with "
                                "retro preprocessing args." %
                                neighbor_dir)
            torch.distributed.barrier()
            exit()
        if verify_sizes and n_sample_chunks != n_neighbor_chunks:
            if torch.distributed.get_rank() == 0:
                print("neighbor_dir : %s" % neighbor_dir)
                print("neighbor_path_map : %s" % neighbor_path_map)
                raise Exception("num sampled chunks (%d) != num neighbor chunks "
                                "(%d); did you complete querying the entire "
                                "pretraining dataset?"
                                % (n_sample_chunks, n_neighbor_chunks))
            torch.distributed.barrier()
            exit()
        # Retro dataset.
        retro_dataset_map[data_key] = RetroDataset(
            num_neighbors=args.retro_num_neighbors,
            num_retrieved_chunks=args.retro_num_retrieved_chunks,
            block_size=retro_args.retro_block_size,
            db_dataset=db_dataset,
            chunk_dataset=chunk_dataset,
            neighbor_path_map=neighbor_path_map,
        )
    # Extract datasets.
    train_ds = retro_dataset_map.get("train", None)
    valid_ds = retro_dataset_map.get("valid", None)
    test_ds = retro_dataset_map.get("test", None)
    return train_ds, valid_ds, test_ds