human
I wrote the below code

    for custom_getter in custom_getter_map.values():
        if (not callable(custom_getter)):
            raise TypeError('Given    custom_getter    is    not    callable.')
    def _custom_getter(getter, name, *args, **kwargs):
        'A    custom    getter    that    routes    based    on    pattern    matching    the    variable    name.\n\n                Args:\n                        getter:    The    true    getter    to    call.\n                        name:    The    fully    qualified    variable    name,    i.e.    including    all    scopes.\n                        *args:    Arguments,    in    the    same    format    as    tf.get_variable.\n                        **kwargs:    Keyword    arguments,    in    the    same    format    as    tf.get_variable.\n\n                Returns:\n                        The    return    value    of    the    appropriate    custom    getter.    If    there    are    no\n                        matches,    it    returns    the    return    value    of    `getter`.\n\n                Raises:\n                        KeyError:    If    more    than    one    pattern    matches    the    variable    name.\n                '
        bare_name = name_fn(name)
        matches = [(custom_getter, pattern) for (pattern, custom_getter) in custom_getter_map.items() if (re.match(pattern, bare_name) is not None)]
        num_matches = len(matches)
        if (num_matches == 0):
            return getter(name, *args, **kwargs)
        elif (num_matches == 1):
            (custom_getter, pattern) = matches[0]
            return custom_getter(getter, name, *args, **kwargs)
        else:
            raise KeyError('More    than    one    custom_getter    matched    {}    ({}):    {}'.format(name, bare_name, [pattern for (_, pattern) in matches]))
    return _custom_getter

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def _custom_getter_router(custom_getter_map, name_fn):