def METHOD_NAME(args, places=None):
    data_files = {"train": args.training_file, "dev": args.validation_file}
    datasets = [load_dataset(read, src_tgt_file=filename, lazy=False) for split, filename in data_files.items()]
    src_vocab = Vocab.load_vocabulary(
        args.src_vocab_fpath,
        bos_token=args.special_token[0],
        eos_token=args.special_token[1],
        unk_token=args.special_token[2],
    )
    trg_vocab = Vocab.load_vocabulary(
        args.trg_vocab_fpath,
        bos_token=args.special_token[0],
        eos_token=args.special_token[1],
        unk_token=args.special_token[2],
    )
    args.src_vocab_size = len(src_vocab)
    args.trg_vocab_size = len(trg_vocab)
    def convert_samples(sample):
        source = [item.strip() for item in sample["src"].split()]
        target = [item.strip() for item in sample["trg"].split()]
        source = src_vocab.to_indices(source) + [args.eos_idx]
        target = [args.bos_idx] + trg_vocab.to_indices(target) + [args.eos_idx]
        return source, target
    data_loaders = [(None)] * 2
    for i, dataset in enumerate(datasets):
        dataset = dataset.map(convert_samples, lazy=False).filter(partial(min_max_filer, max_len=args.max_length))
        sampler = SamplerHelper(dataset)
        if args.sort_type == SortType.GLOBAL:
            src_key = lambda x, data_source: len(data_source[x][0])
            trg_key = lambda x, data_source: len(data_source[x][1])
            # Sort twice
            sampler = sampler.sort(key=trg_key).sort(key=src_key)
        else:
            if args.shuffle:
                sampler = sampler.shuffle(seed=args.random_seed)
            max_key = lambda x, data_source: max(len(data_source[x][0]), len(data_source[x][1]))
            if args.sort_type == SortType.POOL:
                sampler = sampler.sort(key=max_key, buffer_size=args.pool_size)
        batch_size_fn = lambda new, count, sofar, data_source: max(
            sofar, len(data_source[new][0]), len(data_source[new][1])
        )
        batch_sampler = sampler.batch(
            batch_size=args.batch_size,
            drop_last=False,
            batch_size_fn=batch_size_fn,
            key=lambda size_so_far, minibatch_len: size_so_far * minibatch_len,
        )
        if args.shuffle_batch:
            batch_sampler = batch_sampler.shuffle(seed=args.random_seed)
        if i == 0:
            batch_sampler = batch_sampler.shard()
        data_loader = DataLoader(
            dataset=dataset,
            places=places,
            batch_sampler=batch_sampler,
            collate_fn=partial(prepare_train_input, pad_idx=args.bos_idx),
            num_workers=0,
        )
        data_loaders[i] = data_loader
    return data_loaders