code: def from_string(cls, value):
          
          match = cls.pattern.search(value)
          if match is None:
              raise ValueError('"%s" is not a valid media type' % value)
          try:
              return cls(match.group('mime_type'), float(match.group('weight') or 1))
          except ValueError:
              return cls(value)
docs: Return single instance parsed from given accept header string.