human
I wrote the below code

    cls = getattr(fun, 'im_class', None)
    method_name = fun.__name__
    if alt:
        cmd_prefix = alt
    elif cls:
        cmd_prefix = ((cls + '.') + method_name)
    else:
        cmd_prefix = method_name
    cmd_prefix = cmd_prefix.lower()
    args = collect_args()
    if (cmd_prefix in args):
        fun = pydoc.locate(args[cmd_prefix])
    if (type(fun) == type):
        argspec = inspect.getargspec(fun.__init__)
    else:
        argspec = inspect.getargspec(fun)
    defaults = dict(list(zip(argspec.args[(- len((argspec.defaults or []))):], (argspec.defaults or []))))
    replaced_kwargs = {}
    cmd_prefix += '-'
    if (type(fun) == type):
        meta = getattr(fun.__init__, '__tweak_type_hint_meta__', {})
    else:
        meta = getattr(fun, '__tweak_type_hint_meta__', {})
    for (k, v) in args.items():
        if k.startswith(cmd_prefix):
            stripped = k[len(cmd_prefix):].replace('-', '_')
            if (stripped in meta):
                log(('replacing    %s    in    %s    with    %s' % (stripped, str(fun), str(v))))
                replaced_kwargs[stripped] = meta[stripped](v)
            elif (stripped not in argspec.args):
                raise ValueError(('%s    is    not    an    explicit    parameter    of    %s' % (stripped, str(fun))))
            elif (stripped not in defaults):
                raise ValueError(('%s    does    not    have    a    default    value    in    method    %s' % (stripped, str(fun))))
            elif (defaults[stripped] is None):
                raise ValueError(('Cannot    infer    type    of    %s    in    method    %s    from    None    value' % (stripped, str(fun))))
            else:
                log(('replacing    %s    in    %s    with    %s' % (stripped, str(fun), str(v))))
                replaced_kwargs[stripped] = type(defaults[stripped])(v)
    def tweaked(*args, **kwargs):
        all_kw = dict(((list(zip(argspec[0], args)) + list(kwargs.items())) + list(replaced_kwargs.items())))
        return fun(**all_kw)
    return tweaked

What's a good function header?
assistant
#Here is Python program to fix = alt
.

def tweakfun(fun, alt=None):