code: def get_num_features(estimator):
      """Return size of a feature vector estimator expects as an input."""
      if hasattr(estimator, "coef_"):  # linear models
          if len(estimator.coef_.shape) == 0:
              return 1
          return estimator.coef_.shape[-1]
      elif hasattr(estimator, "feature_importances_"):  # ensembles
          return estimator.feature_importances_.shape[-1]
      elif hasattr(estimator, "feature_count_"):  # naive bayes
          return estimator.feature_count_.shape[-1]
      elif hasattr(estimator, "theta_"):
          return estimator.theta_.shape[-1]
      elif hasattr(estimator, "estimators_") and len(
          estimator.estimators_
      ):
          # OvR
          return get_num_features(estimator.estimators_[0])
      else:
          raise ValueError(
              "Can't figure out feature vector size for %s" % estimator
          )
  
imports: from __future__ import absolute_import
  from distutils.version import LooseVersion
  from typing import Any, Optional, List, Tuple
  import numpy
  import scipy.sparse
  from sklearn.multiclass import OneVsRestClassifier
  from eli5.sklearn.unhashing import invert_hashing_and_fit, handle_hashing_vec
  from eli5._feature_names import FeatureNames
label_desc: Use image node_id 11 for calling a global function with example usage: get_num_features(estimator) and returns: estimator, int, estimator, estimator, estimator, get_num_features