def get_renderers(self, request, context=None, template_name=None,<EOL>accept_header=None, formats=None, default_format=None, fallback_formats=None,<EOL>early=False):
if formats:<EOL><INDENT>renderers, seen_formats = [], set()<EOL>for format in formats:<EOL><INDENT>if format in self.renderers_by_format and format not in seen_formats:<EOL><INDENT>renderers.extend(self.renderers_by_format[format])<EOL>seen_formats.add(format)<EOL><DEDENT><DEDENT><DEDENT>elif accept_header:<EOL><INDENT>accepts = MediaType.parse_accept_header(accept_header)<EOL>renderers = MediaType.resolve(accepts, self.renderers)<EOL><DEDENT>elif default_format:<EOL><INDENT>renderers = self.renderers_by_format[default_format]<EOL><DEDENT>else:<EOL><INDENT>renderers = []<EOL><DEDENT>fallback_formats = fallback_formats if isinstance(fallback_formats, (list, tuple)) else (fallback_formats,)<EOL>for format in fallback_formats:<EOL><INDENT>for renderer in self.renderers_by_format[format]:<EOL><INDENT>if renderer not in renderers:<EOL><INDENT>renderers.append(renderer)<EOL><DEDENT><DEDENT><DEDENT>if not early and context is not None and template_name:<EOL><INDENT>renderers = [r for r in renderers if r.test(request, context, template_name)]<EOL><DEDENT>return renderers<EOL>
Returns a list of renderer functions in the order they should be tried.

Tries the format override parameter first, then the Accept header. If
neither is present, attempt to fall back to self._default_format. If
a fallback format has been specified, we try that last.

If early is true, don't test renderers to see whether they can handle
a serialization. This is useful if we're trying to find all relevant
serializers before we've built a context which they will accept.