code: def parse_content_type(ct: str) -> Tuple[str, str, Mapping[str, str]]:
      
      pieces = ct.split(";")
      try:
          main_type, sub_type = pieces[0].split("/")
      except ValueError:
          msg = 'Invalid mime-type component: "{0}"'.format(pieces[0])
          raise ValueError(msg)
      if len(pieces) > 1:
          options = {}
          for opt in pieces[1:]:
              opt = opt.strip()
              if not opt:
                  continue
              try:
                  k, v = opt.split("=", 1)
              except ValueError:
                  msg = 'Invalid option component: "{0}"'.format(opt)
                  raise ValueError(msg)
              else:
                  options[k.lower()] = v.lower()
      else:
          options = {}
      return main_type.lower(), sub_type.lower(), options
docs: Decompose the value of HTTP "Content-Type" header into
      the main/sub MIME types and other extra options as a dictionary.
      All parsed values are lower-cased automatically.