code: def pandas_wrapper(
      func, trim_head=None, trim_tail=None, names=None, *args, **kwargs
  ):
      @wraps(func)
      def new_func(X, *args, **kwargs):
          # quick pass-through for do nothing case
          if not _is_using_pandas(X, None):
              return func(X, *args, **kwargs)
  
          wrapper_func = _get_pandas_wrapper(
              X, trim_head, trim_tail, names
          )
          ret = func(X, *args, **kwargs)
          ret = wrapper_func(ret)
          return ret
  
      return new_func
  
file_path: statsmodels/statsmodels/tsa/filters/_utils.py
imports: from functools import wraps
  from statsmodels.tools.data import _is_using_pandas
  from statsmodels.tsa.tsatools import freq_to_period
label_desc: Use image node_id 2 for calling a global function with example usage: pandas_wrapper(func, trim_head, trim_tail, names) and returns: new_func, ret, func