code: def _get_weighted_spans_from_union(doc, vec_union, feature_weights):
      # type: (Any, FeatureUnion, FeatureWeights) -> Optional[WeightedSpans]
      docs_weighted_spans = []
      named_found_features = []
      for vec_name, vec in vec_union.transformer_list:
          vec_prefix = "{}__".format(vec_name)
  
          def feature_fn(name):
              if isinstance(name, FormattedFeatureName):
                  return
              if not name.startswith(vec_prefix):
                  return  # drop feature
              return name[len(vec_prefix) :]  # remove prefix
  
          result = _get_doc_weighted_spans(
              doc, vec, feature_weights, feature_fn
          )
          if result:
              found_features, doc_weighted_spans = result
              doc_weighted_spans.vec_name = vec_name
              named_found_features.append((vec_name, found_features))
              docs_weighted_spans.append(doc_weighted_spans)
  
      if docs_weighted_spans:
          return WeightedSpans(
              docs_weighted_spans,
              other=_get_other(feature_weights, named_found_features),
          )
      else:
          return None
  
file_path: eli5/eli5/sklearn/text.py
imports: from __future__ import absolute_import
  from typing import Any, Union, Callable, Dict, List, Optional, Set, Tuple
  from sklearn.pipeline import FeatureUnion
  from eli5.base import DocWeightedSpans, WeightedSpans, FeatureWeights, FeatureWeight, TargetExplanation
  from eli5.formatters import FormattedFeatureName
  from eli5.sklearn.unhashing import InvertableHashingVectorizer
  from eli5.sklearn._span_analyzers import build_span_analyzer
label_desc: Use image node_id 6 for calling a global function with example usage: _get_weighted_spans_from_union(doc, vec_union, feature_weights) and returns: WeightedSpans, None, name