code: def build_hamlet_jz_corpus_with_meta():
      # type: () -> Corpus
      def empath_mock(doc, **kwargs):
          toks = list(doc)
          num_toks = min(3, len(toks))
          return {
              "cat" + str(len(tok)): val
              for val, tok in enumerate(toks[:num_toks])
          }
  
      categories, documents = get_docs_categories()
      clean_function = lambda text: "" if text.startswith("[") else text
      df = pd.DataFrame(
          {
              "category": categories,
              "parsed": [
                  whitespace_nlp(clean_function(doc))
                  for doc in documents
              ],
          }
      )
      df = df[df["parsed"].apply(lambda x: len(str(x).strip()) > 0)]
      return CorpusFromParsedDocuments(
          df=df,
          category_col="category",
          parsed_col="parsed",
          feats_from_spacy_doc=FeatsFromSpacyDocAndEmpath(
              empath_analyze_function=empath_mock
          ),
      ).build()
  
imports: import re
  from unittest import TestCase
  import pandas
  from sklearn.feature_extraction.text import TfidfTransformer
  from sklearn.linear_model import PassiveAggressiveClassifier
  from scattertext import CorpusFromParsedDocuments
  from scattertext import FeatsFromSpacyDoc, FeatsFromSpacyDocAndEmpath
  from scattertext import TermDocMatrixFactory
  from scattertext.TermDocMatrixFactory import FeatsFromDoc
  from scattertext.WhitespaceNLP import whitespace_nlp, Doc, Tok
label_desc: Use image node_id 6 for calling a global function with example usage: build_hamlet_jz_corpus_with_meta() and returns: CorpusFromParsedDocuments, unknown