old_contents: def get_required_field(headers, key):
      if key not in headers:
          raise ProtocolError("'{}' is required.".format(key))
      return headers[key]
  
  
new_contents: from weavelib.exceptions import ProtocolError
  
  
  def get_required_field(headers, key):
      if key not in headers:
          raise ProtocolError("'{}' is required.".format(key))
      return headers[key]
  
subject: Fix imports.