human
Complete this python program:
def define(f):
assistant
#Here is the Python code you requested.

    """Returns (name, type, tuple, dict) for the given function,
    with a tuple of argument names and a dict of keyword arguments.
    If the given function has *args, returns True instead of tuple.
    If the given function has **kwargs, returns True instead of dict.
    """
    def undecorate(f):
        while getattr(f, 'func_closure', None):
            f = [v.cell_contents for v in getattr(f, 'func_closure')]
            f = [v for v in f if callable(v)]
            f = f[0]
        return f
    f = undecorate(f)
    a = inspect.getargspec(f)
    i = (len(a[0]) - len((a[3] or [])))
    x = tuple(a[0][:i])
    y = dict(zip(a[0][i:], (a[3] or [])))
    x = (x if (not a[1]) else True)
    y = (y if (not a[2]) else True)
    return (f.__name__, type(f), x, y)