code: def parse(self, line):
          
          # find command type and check validity
          if not line:
              raise KatcpSyntaxError("Empty message received.")
  
          type_char = line[0]
          if type_char not in self.TYPE_SYMBOL_LOOKUP:
              raise KatcpSyntaxError("Bad type character %r." % (type_char,))
  
          mtype = self.TYPE_SYMBOL_LOOKUP[type_char]
  
          # find command and arguments name
          # (removing possible empty argument resulting from whitespace at end
          #  of command)
          parts = self.WHITESPACE_RE.split(line)
          if not parts[-1]:
              del parts[-1]
  
          name = parts[0][1:]
          arguments = [self._parse_arg(x) for x in parts[1:]]
  
          # split out message id
          match = self.NAME_RE.match(name)
          if match:
              name = match.group('name')
              mid = match.group('id')
          else:
              raise KatcpSyntaxError("Bad message name (and possibly id) %r." %
                                     (name,))
  
          return Message(mtype, name, arguments, mid)
docs: Parse a line, return a Message.
  
          Parameters
          ----------
          line : str
              The line to parse (should not contain the terminating newline
              or carriage return).
  
          Returns
          -------
          msg : Message object
              The resulting Message.