              return 1
          elif self.sub_type == '*':
              return 2
          elif not self.params or self.params.keys() == ['q']:
              return 3
          return 4
  
      def quality(self):
          """
          Return a quality level for the media type.
          """
          try:
              return Decimal(self.params.get('q', '1.0'))
          except:
              return Decimal(0)
      
      def score(self):
          """
          Return an overall score for a given media type given it's quality and precedence.
          """
          # NB. quality values should only have up to 3 decimal points
          # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
          return self.quality * 10000 + self.precedence
      
      def as_tuple(self):
          return (self.main_type, self.sub_type, self.params)
  
      def __repr__(self):
 
</s> remove     def as_tuple(self):
        return (self.main_type, self.sub_type, self.params)
 </s> add     #def as_tuple(self):
    #    return (self.main_type, self.sub_type, self.params) </s> remove             return 1
 </s> add             return 0 </s> remove             return 2
 </s> add             return 1 </s> remove         Return a precedence level for the media type given how specific it is.
 </s> add         Return a precedence level from 0-3 for the media type given how specific it is. </s> remove     def __repr__(self):
        return "<MediaType %s>" % (self.as_tuple(),)
 </s> add     #def __repr__(self):
    #    return "<MediaType %s>" % (self.as_tuple(),)
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
              return 1
          elif self.sub_type == '*':
              return 2
          elif not self.params or self.params.keys() == ['q']:
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
            return 2
        return 3

    #def quality(self):
    #    """
    #    Return a quality level for the media type.
    #    """
    #    try:
    #        return Decimal(self.params.get('q', '1.0'))
    #    except:
    #        return Decimal(0)
 
    #def score(self):
    #    """
    #    Return an overall score for a given media type given it's quality and precedence.
    #    """
    #    # NB. quality values should only have up to 3 decimal points
    #    # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
    #    return self.quality * 10000 + self.precedence
      
      def as_tuple(self):
          return (self.main_type, self.sub_type, self.params)
  
      def __repr__(self):
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Renderers can now cope with parameterised args.  ResponseMixin gets cleaned up & added Renderer.can_handle_response(), mirroring Parsers.can_handle_request() 
djangorestframework/utils/mediatypes.py