  hard_coded_bullets_re = re.compile(r'((?:<p>(?:%s).*?[a-zA-Z].*?</p>\s*)+)' % '|'.join([re.escape(x) for x in DOTS]), re.DOTALL)
  trailing_empty_content_re = re.compile(r'(?:<p>(?:&nbsp;|\s|<br \/>)*?</p>\s*)+\Z')
  
  
  # Helper function for 'add_query_param'
  def replace_query_param(url, key, val):
      """
      Given a URL and a key/val pair, set or replace an item in the query
      parameters of the URL, and return the new URL.
      """
      (scheme, netloc, path, query, fragment) = urlsplit(url)
      query_dict = QueryDict(query).copy()
      query_dict[key] = val
      query = query_dict.urlencode()
      return urlunsplit((scheme, netloc, path, query, fragment))
  
  
  # And the template tags themselves...
  
  @register.simple_tag
  def optional_login(request):
      """
 
</s> remove         relative_url = '?%s=%d' % (self.page_field, page)
        if request:
            for field, value in request.QUERY_PARAMS.iteritems():
                if field != self.page_field:
                    relative_url += '&%s=%s' % (field, value)
            return request.build_absolute_uri(relative_url)
        return relative_url
 </s> add         url = request and request.get_full_path() or ''
        return replace_query_param(url, self.page_field, page) </s> remove         relative_url = '?%s=%d' % (self.page_field, page)
        if request:
            for field, value in request.QUERY_PARAMS.iteritems():
                if field != self.page_field:
                    relative_url += '&%s=%s' % (field, value)
            return request.build_absolute_uri(relative_url)
        return relative_url
 </s> add         url = request and request.get_full_path() or ''
        return replace_query_param(url, self.page_field, page) </s> remove     @unittest.skip('can\'t pass because view is a simple Django view and response is an ImmediateResponse')
    def test_unsatisfiable_accept_header_on_request_returns_406_status(self):
        """If the Accept header is unsatisfiable we should return a 406 Not Acceptable response."""
        resp = self.client.get('/', HTTP_ACCEPT='foo/bar')
        self.assertEquals(resp.status_code, status.HTTP_406_NOT_ACCEPTABLE)

 </s> add  </s> remove     filter_class = None
    filter_fields = None

    def get_filter_class(self):
        """
        Return the django-filters `FilterSet` used to filter the queryset.
        """
        if self.filter_class:
            return self.filter_class

        if self.filter_fields:
            class AutoFilterSet(django_filters.FilterSet):
                class Meta:
                    model = self.model
                fields = self.filter_fields
            return AutoFilterSet

        return None
 </s> add     filter_backend = api_settings.FILTER_BACKEND
  hard_coded_bullets_re = re.compile(r'((?:<p>(?:%s).*?[a-zA-Z].*?</p>\s*)+)' % '|'.join([re.escape(x) for x in DOTS]), re.DOTALL)
  trailing_empty_content_re = re.compile(r'(?:<p>(?:&nbsp;|\s|<br \/>)*?</p>\s*)+\Z')
  
  













  # And the template tags themselves...
  
  @register.simple_tag
  def optional_login(request):
      """
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Make filtering optional, and pluggable. 
rest_framework/templatetags/rest_framework.py