<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def binding(key, registry=None):
 """ Creates a decorator that binds a factory function to a key. :param key: the binding key :param: registry: the registry to bind to; defaults to the global registry """

    if registry is None:
        registry = _registry

    def decorator(func):
        registry.bind(key, func)
        return func
    return decorator