code: def parse_docs_bist(
      parser,
      docs: Union[str, PathLike],
      out_dir: Union[str, PathLike] = None,
      show_tok=True,
      show_doc=True,
  ):
      """Parse raw documents in the form of text files in a directory or lines in a text file.
  
      Args:
          parser
          docs (str or PathLike)
          out_dir (str or PathLike): If specified, the output will also be written to this path.
          show_tok (bool, optional): Specifies whether to include token text in output.
          show_doc (bool, optional): Specifies whether to include document text in output.
  
      Returns:
          (list of CoreNLPDoc)
      """
      if out_dir:
          Path(out_dir).mkdir(parents=True, exist_ok=True)
  
      params = parser, Path(docs), out_dir, show_tok, show_doc
      parsed_docs = list(
          parse_dir(*params) if isdir(docs) else parse_txt(*params)
      )
      total_parsed = np.sum([len(doc) for doc in parsed_docs])
      return parsed_docs, total_parsed
  
imports: import csv
  import json
  import sys
  from os import walk, path, makedirs, PathLike, listdir
  from os.path import join, isfile, isdir
  from pathlib import Path
  from typing import Union
  from tqdm import tqdm
  import numpy
  from nlp_architect.common.core_nlp_doc import CoreNLPDoc
  from nlp_architect.models.absa import INFERENCE_LEXICONS
  from nlp_architect.models.absa.inference.data_types import LexiconElement, Polarity
  from nlp_architect.models.absa.train.data_types import OpinionTerm
  from nlp_architect.pipelines.spacy_bist import SpacyBISTParser
  from nlp_architect.utils.io import download_unlicensed_file, line_count
  from types import GeneratorType
label_desc: Use image node_id 6 for calling a global function with example usage: parse_docs_bist(parser, docs, out_dir, show_tok, show_doc) and returns: parsed_docs,  total_parsed