code: def get_lock (name, debug=False):
      
      lock = threading.Lock()
      # for thread debugging, use the DebugLock wrapper
      if debug:
          lock = DebugLock(lock, name)
      return lock
docs: Get a new lock.
      @param debug: if True, acquire() and release() will have debug messages
      @ptype debug: boolean, default is False
      @return: a lock object
      @rtype: threading.Lock or DebugLock