code: def read_data(
      input_dir, section, resegment, spaces_after, split_clauses
  ):
      glob_path = os.path.join(input_dir, section, "*.txt")
      filenames = glob.glob(glob_path)
      print("  Found {} files in {}".format(len(filenames), glob_path))
      if len(filenames) == 0:
          raise FileNotFoundError(
              "Could not find any files for the {} section.  Is LST20 installed in {}?".format(
                  section, input_dir
              )
          )
      documents = []
      for filename in filenames:
          with open(filename) as fin:
              lines = fin.readlines()
          if resegment:
              document = retokenize_document(lines)
          else:
              document = read_document(
                  lines, spaces_after, split_clauses
              )
          documents.extend(document)
      return documents
  
file_path: stanza/stanza/utils/datasets/tokenization/convert_th_lst20.py
imports: import argparse
  import glob
  import os
  import sys
  from stanza.utils.datasets.tokenization.process_thai_tokenization import write_section, convert_processed_lines, reprocess_lines
label_desc: Use image node_id 3 for calling a global function with example usage: read_data(input_dir, section, resegment, spaces_after, split_clauses) and returns: documents