code: def _get_features_and_labels_from_documents_and_indexes(
      self,
      category_doc_iter,
      category_idx_store,
      term_idx_store,
      metadata_idx_store,
  ):
      y = []
      X_factory = CSRMatrixFactory()
      mX_factory = CSRMatrixFactory()
      for document_index, (category, parsed_text) in enumerate(
          category_doc_iter
      ):
          self._register_doc_and_category(
              X_factory,
              mX_factory,
              category,
              category_idx_store,
              document_index,
              parsed_text,
              term_idx_store,
              metadata_idx_store,
              y,
          )
      X = X_factory.get_csr_matrix()
      mX = mX_factory.get_csr_matrix()
      y = np.array(y)
      return X, mX, y
  
imports: import string
  from collections import Counter
  import numpy
  import pandas
  from scattertext.CSRMatrixTools import CSRMatrixFactory
  from scattertext.TermDocMatrix import TermDocMatrix
  from scattertext.features.FeatsFromSpacyDoc import FeatsFromSpacyDoc
  from scattertext.indexstore.IndexStore import IndexStore
label_desc: Use image node_id 8 for calling the TermDocMatrixFactory obj's underlying member method code with example usage: obj._get_features_and_labels_from_documents_and_indexes(category_doc_iter, category_idx_store, term_idx_store, metadata_idx_store) and returns: X,  mX,  y