code: def make_wrapper(func, how):
      @functools.wraps(func)
      def wrapper(self, *args, **kwargs):
          results = object.__getattribute__(self, "_results")
          data = results.model.data
          if how and isinstance(how, tuple):
              obj = data.wrap_output(
                  func(results, *args, **kwargs), how[0], how[1:]
              )
          elif how:
              obj = data.wrap_output(
                  func(results, *args, **kwargs), how
              )
          return obj
  
      sig = inspect.signature(func)
      formatted = str(sig)
  
      doc = dedent(wrapper.__doc__) if wrapper.__doc__ else ""
      wrapper.__doc__ = "\n{}{}\n{}".format(
          func.__name__, formatted, doc
      )
  
      return wrapper
  
file_path: statsmodels/statsmodels/base/wrapper.py
imports: import functools
  import inspect
  from textwrap import dedent
label_desc: Use image node_id 2 for calling a global function with example usage: make_wrapper(func, how) and returns: wrapper, obj