code: def new_message_from_header(header):
      
      message_type = header.message_type
      if not isinstance(message_type, Type):
          try:
              if isinstance(message_type, str):
                  message_type = Type[message_type]
              elif isinstance(message_type, int):
                  message_type = Type(message_type)
          except ValueError:
              raise ValueError
  
      message = new_message_from_message_type(message_type)
      message.header.xid = header.xid
      message.header.length = header.length
  
      return message
docs: Given an OF Header, return an empty message of header's message_type.
  
      Args:
          header (~pyof.v0x01.common.header.Header): Unpacked OpenFlow Header.
  
      Returns:
          Empty OpenFlow message of the same type of message_type attribute from
          the given header.
          The header attribute of the message will be populated.
  
      Raises:
          KytosUndefinedMessageType: Unkown Message_Type.