def render(self, context):
        commands = []
        identity = get_identity(context, 'mixpanel')
        if identity is not None:
            if isinstance(identity, dict):
                commands.append(IDENTIFY_CODE % identity.get('id', identity.get('username')))
                commands.append(IDENTIFY_PROPERTIES % json.dumps(identity, sort_keys=True))
            else:
                commands.append(IDENTIFY_CODE % identity)
        try:
            name, properties = context[EVENT_CONTEXT_KEY]
            commands.append(EVENT_CODE % {'name': name,
                    'properties': json.dumps(properties, sort_keys=True)})
        except __HOLE__:
            pass
        html = TRACKING_CODE % {'token': self._token,
                'commands': " ".join(commands)}
        if is_internal_ip(context, 'MIXPANEL'):
            html = disable_html(html, 'Mixpanel')
        return mark_safe(html)
dataset/ETHPy150Open jcassee/django-analytical/analytical/templatetags/mixpanel.py/MixpanelNode.render