code: def get_real_func(obj):
      """gets the real function object of the (possibly) wrapped object by
      functools.wraps or functools.partial.
      """
      start_obj = obj
      for i in range(100):
          # __pytest_wrapped__ is set by @pytest.fixture when wrapping the fixture function
          # to trigger a warning if it gets called directly instead of by pytest: we don't
          # want to unwrap further than this otherwise we lose useful wrappings like @mock.patch (#3774)
          new_obj = getattr(obj, "__pytest_wrapped__", None)
          if isinstance(new_obj, _PytestWrapper):
              obj = new_obj.obj
              break
          new_obj = getattr(obj, "__wrapped__", None)
          if new_obj is None:
              break
          obj = new_obj
      else:
          raise ValueError(
              (
                  "could not find real function of {start}\nstopped at {current}"
              ).format(start=saferepr(start_obj), current=saferepr(obj))
          )
      if isinstance(obj, functools.partial):
          obj = obj.func
      return obj
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import codecs
  import functools
  import inspect
  import re
  import sys
  from contextlib import contextmanager
  import attr
  import py
  import six
  from six import text_type
  import _pytest
  from _pytest._io.saferepr import saferepr
  from _pytest.outcomes import fail
  from _pytest.outcomes import TEST_OUTCOME
label_desc: Use image node_id 10 for calling a global function with example usage: get_real_func(obj) and returns: obj