code: def invert_hashing_and_fit(
      vec,  # type: Union[FeatureUnion, HashingVectorizer]
      docs,
  ):
      # type: (...) -> Union[FeatureUnion, InvertableHashingVectorizer]
      """Create an :class:`~.InvertableHashingVectorizer` from hashing
      vectorizer vec and fit it on docs. If vec is a FeatureUnion, do it for all
      hashing vectorizers in the union.
      Return an :class:`~.InvertableHashingVectorizer`, or a FeatureUnion,
      or an unchanged vectorizer.
      """
      if isinstance(vec, HashingVectorizer):
          vec = InvertableHashingVectorizer(vec)
          vec.fit(docs)
      elif isinstance(vec, FeatureUnion) and any(
          isinstance(v, HashingVectorizer)
          for _, v in vec.transformer_list
      ):
          vec = _fit_invhashing_union(vec, docs)
      return vec
  
imports: from __future__ import absolute_import
  from collections import defaultdict, Counter
  from itertools import chain
  from typing import List, Iterable, Any, Dict, Tuple, Union
  import numpy
  import six
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.feature_extraction.text import HashingVectorizer, FeatureHasher
  from sklearn.pipeline import FeatureUnion
  from eli5._feature_names import FeatureNames
label_desc: Use image node_id 8 for calling a global function with example usage: invert_hashing_and_fit(vec, docs) and returns: vec