<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def Lock(fd, path, blocking):
 """Lock the provided file descriptor. Args: fd: int, the file descriptor of the file to lock. path: string, the name of the file to lock. blocking: bool, whether the function should return immediately. Raises: IOError, raised from flock while attempting to lock a file. """

  operation = fcntl.LOCK_EX if blocking else fcntl.LOCK_EX | fcntl.LOCK_NB
  try:
    fcntl.flock(fd, operation)
  except IOError as e:
    if e.errno == errno.EWOULDBLOCK:
      raise IOError('Exception locking %s. File already locked.' % path)
    else:
      raise IOError('Exception locking %s. %s.' % (path, str(e)))