human
Complete the below
def defer_to_globals(name, falsey=None):

    ''''Allow function to be taken over by globals
    This modifies a function so that occurrences of it may be taken over by
    functions registered in the global options.  It is commonly used as a
    decorator.
    Parameters
    name: str
    name under which we register this function in the global parameters
    falsey: callable, None, optional
    A function to use if the option is falsey
    Examples
    >>> import dask
    >>> @defer_to_globals(\'foo\')
    ... def f():
    ...     return 1
    >>> f()
    1
    >>> with dask.set_options(foo=lambda: 2):
    ...     print(f())
    2'
    '''

Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    def _(func):
        @functools.wraps(func)
        def f(*args, **kwargs):
            if (name in _globals):
                if _globals[name]:
                    return _globals[name](*args, **kwargs)
                elif falsey:
                    return falsey(*args, **kwargs)
            else:
                return func(*args, **kwargs)
        return f
    return _