def METHOD_NAME(data_folder, folder_name, output_folder, detokenizer, remove_newlines):
    if not os.path.isdir(os.path.join(data_folder, folder_name)):
        return
    print(f'Processing {folder_name}')
    train_fname = os.path.join(data_folder, folder_name, 'train.tfrecord-00000-of-00001')
    valid_fname = os.path.join(data_folder, folder_name, 'validation.tfrecord-00000-of-00001')
    test_fname = os.path.join(data_folder, folder_name, 'test.tfrecord-00000-of-00001')
    if not os.path.exists(train_fname):
        print(f'Could not find {train_fname}')
        return
    write_train_val_test_dataset_to_file(
        train_fname, folder_name, output_folder, detokenizer, 'train', remove_newlines
    )
    if os.path.exists(valid_fname):
        write_train_val_test_dataset_to_file(
            valid_fname, folder_name, output_folder, detokenizer, 'val', remove_newlines
        )
    if os.path.exists(test_fname):
        write_train_val_test_dataset_to_file(
            test_fname, folder_name, output_folder, detokenizer, 'test', remove_newlines
        )