def METHOD_NAME(data_folder, output_folder, remove_newlines):
    detokenizer = MosesDetokenizer('en')
    assert os.path.isdir(data_folder)
    if not os.path.exists(output_folder):
        os.system(f'mkdir -p {output_folder}')
    if not os.path.exists(os.path.join(output_folder, 'train')):
        os.system(f'mkdir -p {os.path.join(output_folder, "train")}')
    if not os.path.exists(os.path.join(output_folder, 'val')):
        os.system(f'mkdir -p {os.path.join(output_folder, "val")}')
    if not os.path.exists(os.path.join(output_folder, 'test')):
        os.system(f'mkdir -p {os.path.join(output_folder, "test")}')
    print(f'Found {len(os.listdir(data_folder))} folders to process ...')
    pool_args = []
    for folder_name in os.listdir(data_folder):
        pool_args.append((data_folder, folder_name, output_folder, detokenizer, remove_newlines))
    pool = Pool()
    pool.starmap(process_folder, pool_args)