def METHOD_NAME(
        cls, args: argparse.Namespace, train: bool
) -> Optional[Callable[[str, Dict[str, np.array]], Dict[str, np.ndarray]]]:
    token_types = [args.token_type, args.token_type]
    token_lists = [args.token_list, args.punc_list]
    bpemodels = [args.bpemodel, args.bpemodel]
    text_names = ["text", "punc"]
    if args.use_preprocessor:
        retval = PuncTrainTokenizerCommonPreprocessor(
            train=train,
            token_type=token_types,
            token_list=token_lists,
            bpemodel=bpemodels,
            text_cleaner=args.cleaner,
            g2p_type=args.g2p,
            text_name = text_names,
            non_linguistic_symbols=args.non_linguistic_symbols,
        )
    else:
        retval = None
    return retval