code: def _wrap_data_with_container(
      method, data_to_wrap, original_input, estimator
  ):
      """Wrap output with container based on an estimator's or global config.
  
      Parameters
      ----------
      method : {"transform"}
          Estimator's method to get container output for.
  
      data_to_wrap : {ndarray, dataframe}
          Data to wrap with container.
  
      original_input : {ndarray, dataframe}
          Original input of function.
  
      estimator : estimator instance
          Estimator with to get the output configuration from.
  
      Returns
      -------
      output : {ndarray, dataframe}
          If the output config is "default" or the estimator is not configured
          for wrapping return `data_to_wrap` unchanged.
          If the output config is "pandas", return `data_to_wrap` as a pandas
          DataFrame.
      """
      output_config = _get_output_config(method, estimator)
  
      if output_config[
          "dense"
      ] == "default" or not _auto_wrap_is_configured(estimator):
          return data_to_wrap
  
      def _is_pandas_df(X):
          """Return True if the X is a pandas dataframe.
  
          This is is backport from 1.4 in 1.3.1 for compatibility.
          """
          import sys
  
          if hasattr(X, "columns") and hasattr(X, "iloc"):
              # Likely a pandas DataFrame, we explicitly check the type to confirm.
              try:
                  pd = sys.modules["pandas"]
              except KeyError:
                  return False
              return isinstance(X, pd.DataFrame)
          return False
  
      # dense_config == "pandas"
      index = (
          original_input.index
          if _is_pandas_df(original_input)
          else None
      )
      return _wrap_in_pandas_container(
          data_to_wrap=data_to_wrap,
          index=index,
          columns=estimator.get_feature_names_out,
      )
  
file_path: catboost/contrib/python/scikit-learn/py3/sklearn/utils/_set_output.py
imports: from functools import wraps
  from scipy.sparse import issparse
  from .._config import get_config
  from .None import check_pandas_support
  from ._available_if import available_if
label_desc: Use image node_id 3 for calling a global function with example usage: _wrap_data_with_container(method, data_to_wrap, original_input, estimator) and returns: _wrap_in_pandas_container, data_to_wrap, False, isinstance, False