code: def __build_document_from_manifests(
      data_root: str,
      manifests: str,
  ):
      if "," in manifests:
          manifests = manifests.split(",")
      else:
          manifests = [manifests]
  
      document_dir = os.path.join(data_root, "text_corpus")
      if not os.path.exists(document_dir):
          os.makedirs(document_dir)
  
      document_path = os.path.join(document_dir, "document.txt")
  
      if os.path.exists(document_path):
          logging.info(
              "Corpus already exists at path : %s", document_path
          )
          return document_path
  
      num_lines = 0
      with open(document_path, "w") as out_writer:
          for manifest in manifests:
              with open(
                  DataStoreObject(manifest).get(), "r"
              ) as in_reader:
                  for line in in_reader:
                      item = json.loads(line)
                      text = item["text"]
  
                      out_writer.write(text + "\n")
                      out_writer.flush()
  
                      num_lines += 1
  
              logging.info(f"Finished extracting manifest : {manifest}")
  
          logging.info(
              "Finished extracting all manifests ! Number of sentences : {}".format(
                  num_lines
              )
          )
      return document_path
  
file_path: NeMo/scripts/tokenizers/process_asr_text_tokenizer.py
imports: import argparse
  import json
  import logging
  import os
  from typing import List, Optional
  import tokenizers
  from nemo.collections.common.tokenizers.sentencepiece_tokenizer import create_spt_model
  from nemo.utils.data_utils import DataStoreObject
label_desc: Use image node_id 1 for calling a global function with example usage: __build_document_from_manifests(data_root, manifests) and returns: document_path, document_path