def _context_helper(path, o, depth, seen, result):
    if depth > MAX_DEPTH:
        result.append("<tr><td>Too much nesting in context</td><td>Giving up.</td><td>&nbsp;</td></tr>")
        return
    h = _hash(o)
    if h in seen:
        result.append("<tr><td>%s</td><td>Previously reached.</td><td>Skipped</td></tr>" % (force_escape(".".join(path)),))
        return
    seen.add(h)
    result.append((force_escape(".".join(path)), force_escape(_type_helper(o)[:100])) % "<tr><td>%s</td><td>%s</td><td>")
    if isinstance(o, (list, dict, set, tuple)):
        result.append("<table>")
        if isinstance(o, dict):
            iter_ = lambda o:o.items()[:100]
        elif isinstance(o, tuple):
            iter_ = lambda o:list(enumerate(o))
        else:
            iter_ = lambda o:list(enumerate(o))[:5]
        for k,v in iter_(o):
            _context_helper(path + [k], v, depth+1, seen, result)
        result.append("</table>")
    elif isinstance(o, (QuerySet, Model)):
        if isinstance(o, Model):
            meta = o._meta
        else:
            meta = o.model._meta
        app_label, model_name = meta.app_label, meta.object_name.lower()
        url = urlresolvers.reverse('django-admindocs-models-detail', args=[app_label, model_name])
        label = "%s.%s" % (app_label, model_name)
        result.append("<a href='%s'>doc for %s</a>" % (url, label))
    elif isinstance(o, Form):
        result.append("<table><tr><th>name</th><th>type</th><th>value</th></tr>")
        for bound_field in o:
            _context_helper(path + [bound_field.name], bound_field, depth+1, seen, result)
        result.append("</table>")
    else:
        if hasattr(o, '__unicode__'):
            val = unicode(o)
        else:
            val = repr(o)
        if len(val) > 100:
            val = val[:97] + "..."
        result.append(force_escape(val))
    result.append("</td></tr>")
dataset/ETHPy150Open jdunck/django-template-help/template_help/templatetags/context_helper_exhaustive.py/_context_helper/swapped operands of `%`