code: def get_train_list(args_train_path):
      train_path = []
      for train_item in args_train_path:
          if os.path.isdir(train_item):
              file_list = os.listdir(train_item)
              train_path.extend(
                  [os.path.join(train_item, file) for file in file_list]
              )
  
          elif os.path.isfile(train_item):
              train_path.append(train_item)
      return sorted(train_path)
  
file_path: NeMo/scripts/asr_language_modeling/ngram_lm/kenlm_utils.py
imports: import gzip
  import json
  import os
  import numpy
  import torch
  from joblib import Parallel, delayed
  from tqdm.auto import tqdm
  import nemo.collections.asr
  from nemo.collections.asr.parts.submodules.ctc_beam_decoding import DEFAULT_TOKEN_OFFSET
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: get_train_list(args_train_path) and returns: sorted