code: def get_func_name(func, resolv_alias=True, win_characters=True):
      """Return the function import path (as a list of module names), and
      a name for the function.
  
      Parameters
      ----------
      func: callable
          The func to inspect
      resolv_alias: boolean, optional
          If true, possible local aliases are indicated.
      win_characters: boolean, optional
          If true, substitute special characters using urllib.quote
          This is useful in Windows, as it cannot encode some filenames
      """
      if hasattr(func, "__module__"):
          module = func.__module__
      else:
          try:
              module = inspect.getmodule(func)
          except TypeError:
              if hasattr(func, "__class__"):
                  module = func.__class__.__module__
              else:
                  module = "unknown"
      if module is None:
          # Happens in doctests, eg
          module = ""
      if module == "__main__":
          try:
              filename = os.path.abspath(inspect.getsourcefile(func))
          except:
              filename = None
          if filename is not None:
              # mangling of full path to filename
              parts = filename.split(os.sep)
              if parts[-1].startswith("<ipython-input"):
                  # function is defined in an IPython session. The filename
                  # will change with every new kernel instance. This hack
                  # always returns the same filename
                  parts[-1] = "__ipython-input__"
              filename = "-".join(parts)
              if filename.endswith(".py"):
                  filename = filename[:-3]
              module = module + "-" + filename
      module = module.split(".")
      if hasattr(func, "func_name"):
          name = func.func_name
      elif hasattr(func, "__name__"):
          name = func.__name__
      else:
          name = "unknown"
      # Hack to detect functions not defined at the module-level
      if resolv_alias:
          # TODO: Maybe add a warning here?
          if (
              hasattr(func, "func_globals")
              and name in func.func_globals
          ):
              if not func.func_globals[name] is func:
                  name = "%s-alias" % name
      if inspect.ismethod(func):
          # We need to add the name of the class
          if hasattr(func, "im_class"):
              klass = func.im_class
              module.append(klass.__name__)
      if os.name == "nt" and win_characters:
          # Stupid windows can't encode certain characters in filenames
          name = _clean_win_chars(name)
          module = [_clean_win_chars(s) for s in module]
      return module, name
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/externals/joblib/func_inspect.py
imports: from itertools import islice
  import inspect
  import warnings
  import re
  import os
  from ._compat import _basestring
  from .logger import pformat
  from ._memory_helpers import open_py_source
  from ._compat import PY3_OR_LATER
label_desc: Use image node_id 3 for calling a global function with example usage: get_func_name(func, resolv_alias, win_characters) and returns: module,  name