def set_renderers(self, request=None, context=None, template_name=None, early=False):
request, context, template_name = self.get_render_params(request, context, template_name)<EOL>args = (self.conneg, context, template_name,<EOL>self._default_format, self._force_fallback_format, self._format_override_parameter)<EOL>if getattr(request, '<STR_LIT>', None) != args:<EOL><INDENT>fallback_formats = self._force_fallback_format or ()<EOL>if not isinstance(fallback_formats, (list, tuple)):<EOL><INDENT>fallback_formats = (fallback_formats,)<EOL><DEDENT>request.renderers = self.conneg.get_renderers(request=request,<EOL>context=context,<EOL>template_name=template_name,<EOL>accept_header=request.META.get('<STR_LIT>'),<EOL>formats=self.format_override,<EOL>default_format=self._default_format,<EOL>fallback_formats=fallback_formats,<EOL>early=early)<EOL>request.renderers_for_view = args<EOL><DEDENT>if self._include_renderer_details_in_context:<EOL><INDENT>self.context['<STR_LIT>'] = [self.renderer_for_context(request, r) for r in self.conneg.renderers]<EOL><DEDENT>return request.renderers<EOL>
Makes sure that the renderers attribute on the request is up
to date. renderers_for_view keeps track of the view that
is attempting to render the request, so that if the request
has been delegated to another view we know to recalculate
the applicable renderers. When called multiple times on the
same view this will be very low-cost for subsequent calls.