def METHOD_NAME():
    args = parse_args()
    if args.level == 2:
        def key_func(x):
            return '/'.join(x.split('/')[-2:])
    else:
        def key_func(x):
            return x.split('/')[-1]
    if args.format == 'rawframes':
        frame_info = parse_directory(
            args.frame_path,
            key_func=key_func,
            rgb_prefix=args.rgb_prefix,
            level=args.level)
    elif args.format == 'videos':
        if args.level == 1:
            video_list = glob.glob(os.path.join(args.frame_path, '*'))
        elif args.level == 2:
            video_list = glob.glob(os.path.join(args.frame_path, '*', '*'))
        frame_info = {
            os.path.relpath(x.split('.')[0], args.frame_path): (x, -1, -1)
            for x in video_list
        }
    split_tp = parse_ucf101_splits(args.level)
    assert len(split_tp) == args.num_split
    out_path = args.out_list_path
    for i, split in enumerate(split_tp):
        lists = build_split_list(split_tp[i], frame_info, shuffle=args.shuffle)
        filename = 'ucf101_train_split_{}_{}.txt'.format(i + 1, args.format)
        PATH = os.path.abspath(args.frame_path)
        with open(os.path.join(out_path, filename), 'w') as f:
            f.writelines([os.path.join(PATH, item) for item in lists[0]])
        filename = 'ucf101_val_split_{}_{}.txt'.format(i + 1, args.format)
        with open(os.path.join(out_path, filename), 'w') as f:
            f.writelines([os.path.join(PATH, item) for item in lists[1]])