code: def _get_feature_names(X):
      """Get feature names from X.
      Support for other array containers should place its implementation here.
      Parameters
      ----------
      X : {ndarray, dataframe} of shape (n_samples, n_features)
          Array container to extract feature names.
          - pandas dataframe : The columns will be considered to be feature
            names. If the dataframe contains non-string feature names, `None` is
            returned.
          - All other array containers will return `None`.
      Returns
      -------
      names: ndarray or None
          Feature names of `X`. Unrecognized array containers will return `None`.
      """
      feature_names = None
  
      # extract feature names for support array containers
      if hasattr(X, "columns"):
          feature_names = np.asarray(X.columns, dtype=object)
  
      if feature_names is None or len(feature_names) == 0:
          return
  
      types = sorted(
          t.__qualname__ for t in set(type(v) for v in feature_names)
      )
  
      # Warn when types are mixed.
      # ints and strings do not warn
      if len(types) > 1 or not (
          types[0].startswith("int") or types[0] == "str"
      ):
          # TODO: Convert to an error in 1.2
          warnings.warn(
              "Feature names only support names that are all strings. "
              f"Got feature names with dtypes: {types}. An error will be raised "
              "in 1.2.",
              FutureWarning,
          )
          return
  
      # Only feature names of all strings are supported
      if types[0] == "str":
          return feature_names
  
imports: import contextlib
  import datetime
  import functools
  import logging
  import warnings
  from collections.abc import Sequence
  from multiprocessing import cpu_count
  from numbers import Integral
  from timeit import default_timer
  import dask
  import dask.array
  import dask.dataframe
  import numpy
  import pandas
  import sklearn.utils.extmath
  import sklearn.utils.validation
  from dask import delayed
  from dask.array.utils import assert_eq
  from dask.dataframe.utils import assert_eq
  from ._utils import ConstantFunction
label_desc: Use image node_id 21 for calling a global function with example usage: _get_feature_names(X) and returns: feature_names