code: def getlocation(function, curdir):
      function = get_real_func(function)
      fn = py.path.local(inspect.getfile(function))
      lineno = function.__code__.co_firstlineno
      if fn.relto(curdir):
          fn = fn.relto(curdir)
      return "%s:%d" % (fn, lineno + 1)
  
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 4 for calling a global function with example usage: getlocation(function, curdir) and returns: unknown