

@register.tag
def render_table(parser, token):
    '\n    Render a HTML table.\n\n    The tag can be given either a `.Table` object, or a queryset. An optional\n    second argument can specify the template to use.\n\n    Example::\n\n        {% render_table table %}\n        {% render_table table "custom.html" %}\n        {% render_table user_queryset %}\n\n    When given a queryset, a `.Table` class is generated dynamically as\n    follows::\n\n        class OnTheFlyTable(tables.Table):\n            class Meta:\n                model = queryset.model\n                attrs = {"class": "paleblue"}\n\n    For configuration beyond this, a `.Table` class must be manually defined,\n    instantiated, and passed to this tag.\n\n    The context should include a *request* variable containing the current\n    request. This allows pagination URLs to be created without clobbering the\n    existing querystring.\n    '
    bits = bits.split_contents()
    try:
        bits.pop(0)
        table = parser.compile_filter(bits.pop(0))
    except ValueError:
        raise TemplateSyntaxError(("'%s' must be given a table or queryset." % bits[0]))
    template = (parser.compile_filter(bits.pop(0)) if bits else None)
    return RenderTableNode(table, template)

dataset/ETHPy150Open bradleyayers/django-tables2/django_tables2/templatetags/django_tables2.py render_table/VarMisuse@21/335 `token`->`bits`