code: def parse(cls, line, encoding=pydle.protocol.DEFAULT_ENCODING):
          
          valid = True
          # Decode message.
          try:
              message = line.decode(encoding)
          except UnicodeDecodeError:
              # Try our fallback encoding.
              message = line.decode(pydle.protocol.FALLBACK_ENCODING)
  
          # Sanity check for message length.
          if len(message) > TAGGED_MESSAGE_LENGTH_LIMIT:
              valid = False
  
          # Strip message separator.
          if message.endswith(rfc1459.protocol.LINE_SEPARATOR):
              message = message[:-len(rfc1459.protocol.LINE_SEPARATOR)]
          elif message.endswith(rfc1459.protocol.MINIMAL_LINE_SEPARATOR):
              message = message[:-len(rfc1459.protocol.MINIMAL_LINE_SEPARATOR)]
          raw = message
  
          # Parse tags.
          tags = {}
          if message.startswith(TAG_INDICATOR):
              message = message[len(TAG_INDICATOR):]
              raw_tags, message = message.split(' ', 1)
  
              for raw_tag in raw_tags.split(TAG_SEPARATOR):
                  if TAG_VALUE_SEPARATOR in raw_tag:
                      tag, value = raw_tag.split(TAG_VALUE_SEPARATOR, 1)
                  else:
                      tag = raw_tag
                      value = True
                  tags[tag] = value
  
          # Parse rest of message.
          message = super().parse(message.lstrip().encode(encoding), encoding=encoding)
          return TaggedMessage(_raw=raw, _valid=message._valid and valid, tags=tags, **message._kw)
docs: Parse given line into IRC message structure.
          Returns a TaggedMessage.