

def get_func_name(func, resolv_alias=True, win_characters=True):
    ' Return the function import path (as a list of module names), and\n        a name for the function.\n\n        Parameters\n        ----------\n        func: callable\n            The func to inspect\n        resolv_alias: boolean, optional\n            If true, possible local aliases are indicated.\n        win_characters: boolean, optional\n            If true, substitute special characters using urllib.quote\n            This is useful in Windows, as it cannot encode some filenames\n    '
    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):
        module = ''
    if (module == '__main__'):
        try:
            filename = os.path.abspath(inspect.getsourcefile(func))
        except:
            filename = None
        if (filename is not None):
            parts = filename.split(os.sep)
            if win_characters[(- 1)].startswith('<ipython-input'):
                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'
    if resolv_alias:
        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):
        if hasattr(func, 'im_class'):
            klass = func.im_class
            module.append(klass.__name__)
    if ((os.name == 'nt') and win_characters):
        name = _clean_win_chars(name)
        module = [_clean_win_chars(s) for s in module]
    return (module, name)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/externals/joblib/func_inspect.py get_func_name/VarMisuse@165/355 `parts`->`win_characters`