docs: def requires_lock(function):
      """
      Decorator to check if the user owns the required lock.
      The first argument must be the filename.
      """
  
      def new_lock_requiring_function(self, filename, *args, **kwargs):
          if self.owns_lock(filename):
              return function(self, filename, *args, **kwargs)
          else:
              raise RequiresLockException()
  
      return new_lock_requiring_function