in tasks/count-or-mem/generate_data.py [0:0]
def generate_fpa(root, train_length, test_span):
root_raw = f'{root}/data/'
pathlib.Path(root_raw).mkdir(parents=True)
put_train_fpa(root_raw, train_length)
test_from, test_to = train_length - test_span, train_length + test_span + 1 # not inclusive
put_test(root_raw, test_from, test_to)
root_bin = f'./{root}/data-bin/'
pathlib.Path(root_bin).mkdir(parents=True)
command = ['fairseq-preprocess', '--source-lang', 'src', '--target-lang',
'dst', '--destdir', root_bin,
'--trainpref', f'{root_raw}/train',
'--validpref', f'{root_raw}/valid',
'--testpref', f'{root_raw}/test']
subprocess.check_call(command)