human
Complete this python program:
def _docker_client(wrapped):
assistant
#Here is the Python program you requested.

    """Decorator to run a function that requires the use of a docker.Client()
    instance.
    """
    @functools.wraps(wrapped)
    def wrapper(*args, **kwargs):
        '\n                                Ensure    that    the    client    is    present\n                                '
        kwargs = salt.utils.args.clean_kwargs(**kwargs)
        timeout = kwargs.pop('client_timeout', NOTSET)
        if (('docker.client' not in __context__) or (not hasattr(__context__['docker.client'], 'timeout'))):
            __context__['docker.client'] = _get_client(timeout=timeout, **kwargs)
        orig_timeout = None
        if ((timeout is not NOTSET) and hasattr(__context__['docker.client'], 'timeout') and (__context__['docker.client'].timeout != timeout)):
            orig_timeout = __context__['docker.client'].timeout
            __context__['docker.client'].timeout = timeout
        ret = wrapped(*args, **kwargs)
        if (orig_timeout is not None):
            __context__['docker.client'].timeout = orig_timeout
        return ret
    return wrapper