                      middle = middle[len(opening):]
                      lead = lead + opening
                  # Keep parentheses at the end only if they're balanced.
                  if (
                      middle.endswith(closing)
                      and middle.count(closing) == middle.count(opening) + 1
                  ):
                      middle = middle[:-len(closing)]
                      trail = closing + trail
  
              # Make URL we want to point to.
 
</s> remove             not USE_FORM_OVERLOADING
            or self._request.method != 'POST'
            or not is_form_media_type(self._content_type)
 </s> add             self._request.method != 'POST' or
            not USE_FORM_OVERLOADING or
            not is_form_media_type(self._content_type) </s> remove                 not getattr(view, 'get_serializer', None)
                or not any(is_form_media_type(parser.media_type) for parser in view.parser_classes)
 </s> add                 not getattr(view, 'get_serializer', None) or
                not any(is_form_media_type(parser.media_type) for parser in view.parser_classes) </s> remove             if not (api_settings.FORM_CONTENT_OVERRIDE
                    and api_settings.FORM_CONTENTTYPE_OVERRIDE):
 </s> add             if not (api_settings.FORM_CONTENT_OVERRIDE and
                    api_settings.FORM_CONTENTTYPE_OVERRIDE): </s> remove         isinstance(field, BaseSerializer) and (key in validated_data)
        and isinstance(validated_data[key], (list, dict))
 </s> add         isinstance(field, BaseSerializer) and
        (key in validated_data) and
        isinstance(validated_data[key], (list, dict)) </s> remove         '.' in field.source and (key in validated_data)
        and isinstance(validated_data[key], (list, dict))
 </s> add         '.' in field.source and
        (key in validated_data) and
        isinstance(validated_data[key], (list, dict))
                    middle.endswith(closing) and
                    middle.count(closing) == middle.count(opening) + 1
                      middle = middle[len(opening):]
                      lead = lead + opening
                  # Keep parentheses at the end only if they're balanced.
                  if (
                    middle.endswith(closing) and
                    middle.count(closing) == middle.count(opening) + 1
                    middle.endswith(closing) and
                    middle.count(closing) == middle.count(opening) + 1
                  ):
                      middle = middle[:-len(closing)]
                      trail = closing + trail
  
              # Make URL we want to point to.
keep keep keep keep replace replace keep keep keep keep keep
 Fixes for latest pep8 updates. Refs #2563. 
rest_framework/templatetags/rest_framework.py