code: def parse(self, string, strict=True):
          '''Parse the string or bytes.
  
          Args:
              strict (bool): If True, errors will not be ignored
  
          Raises:
              :class:`ValueError` if the record is malformed.
          '''
          if isinstance(string, bytes):
              errors = 'strict' if strict else 'replace'
              string = string.decode(self.encoding, errors=errors)
  
          if not self.raw:
              self.raw = string
          else:
              self.raw += string
  
          lines = unfold_lines(string).splitlines()
          for line in lines:
              if line:
                  if ':' not in line:
                      if strict:
                          raise ValueError('Field missing colon.')
                      else:
                          continue
  
                  name, value = line.split(':', 1)
                  name = name.strip()
                  value = value.strip()
                  self.add(name, valuef parse(self, string, strict=True):
          '''Parse the string or bytes.
  
          Args:
              strict (bool): If True, errors will not be ignored
  
          Raises:
              :class:`ValueError` if the record is malformed.
          '''
          if isinstance(string, bytes):
              errors = 'strict' if strict else 'replace'
              string = string.decode(self.encoding, errors=errors)
  
          if not self.raw:
              self.raw = string
          else:
              self.raw += string
  
          lines = unfold_lines(string).splitlines()
          for line in lines:
              if line:
                  if ':' not in line:
                      if strict:
                          raise ValueError('Field missing colon.')
                      else:
                          continue
  
                  name, value = line.split(':', 1)
                  name = name.strip()
                  value = value.strip()
                  self.add(name, value)
docs: Parse the string or bytes.
  
          Args:
              strict (bool): If True, errors will not be ignored
  
          Raises:
              :class:`ValueError` if the record is malformed.