human
Complete the below
def locked(path, timeout=None):

    ''''Decorator which enables locks for decorated function.
    Arguments:
    - path: path for lockfile.
    - timeout (optional): Timeout for acquiring lock.
    Usage:
    @locked(\'/var/run/myname\', timeout=0)
    def myname(...):'
    '''
assistant
#Here is the Python code you requested.
    def decor(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            lock = FileLock(path, timeout=timeout)
            lock.acquire()
            try:
                return func(*args, **kwargs)
            finally:
                lock.release()
        return wrapper
    return decor