def METHOD_NAME():
    parser = _build_arg_parser()
    args = parser.parse_args()
    assert_inputs_exist(parser, args.in_tractogram)
    _, out_extension = os.path.splitext(args.in_tractogram)
    assert_output_dirs_exist_and_empty(parser, args, [], optional=args.out_dir)
    # Check only the first potential output filename, we don't know how many
    # there are yet.
    assert_outputs_exist(parser, args, os.path.join(
        args.out_dir, '{}_0{}'.format(args.out_prefix, out_extension)))
    log_level = logging.WARNING
    if args.verbose:
        log_level = logging.DEBUG
        set_sft_logger_level('INFO')
    logging.getLogger().setLevel(log_level)
    logging.debug("Loading sft.")
    sft = load_tractogram_with_reference(parser, args, args.in_tractogram)
    streamlines_count = len(sft.streamlines)
    if args.nb_chunks:
        chunk_size = int(streamlines_count/args.nb_chunks)
        nb_chunks = args.nb_chunks
    else:
        chunk_size = args.chunk_size
        nb_chunks = int(streamlines_count/chunk_size)+1
    # Check other outputs
    out_names = ['{0}_{1}{2}'.format(args.out_prefix, i, out_extension) for
                 i in range(nb_chunks)]
    assert_outputs_exist(parser, args,
                         [os.path.join(args.out_dir, out_names[i]) for i in
                          range(1, nb_chunks)])
    # All chunks will be equal except the last one
    chunk_sizes = np.ones((nb_chunks,), dtype=np.int16) * chunk_size
    chunk_sizes[-1] += (streamlines_count - chunk_size * nb_chunks)
    if args.do_not_randomize:
        sfts = split_sft_sequentially(sft, chunk_sizes)
    elif args.split_per_cluster:
        # With this version, will contain an additional sft with non-included
        # streamlines. Should be of size close to 0. Not using it.
        sfts = split_sft_randomly_per_cluster(
            sft, chunk_sizes, args.seed, args.qbx_thresholds)
    else:
        sfts = split_sft_randomly(sft, chunk_sizes, args.seed)
    for i in range(nb_chunks):
        out_name = os.path.join(args.out_dir, out_names[i])
        save_tractogram(sfts[i], out_name)