code: def _fit_models(vmodel, tmodel, x, model_is_fit):
      if model_is_fit == True:
          return
      if vmodel is not None:
          try:
              check_is_fitted(vmodel, ["vocabulary_"])
          except NotFittedError:
              vmodel.fit(np.vstack(x).ravel())
      if tmodel is not None:
          try:
              check_is_fitted(tmodel, ["components_"])
          except NotFittedError:
              if isinstance(tmodel, Pipeline):
                  tmodel.fit(np.vstack(x).ravel())
              else:
                  tmodel.fit(vmodel.transform(np.vstack(x).ravel()))
  
file_path: hypertools/hypertools/tools/text2mat.py
imports: import numpy
  import inspect
  from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
  from sklearn.decomposition import LatentDirichletAllocation, NMF
  from sklearn.utils.validation import check_is_fitted
  from sklearn.exceptions import NotFittedError
  from sklearn.pipeline import Pipeline
  from .._shared.helpers import memoize
  from .._shared.params import default_params
  from .load import load
label_desc: Use image node_id 3 for calling a global function with example usage: _fit_models(vmodel, tmodel, x, model_is_fit) without return types