<commit_before>from django import template
from django.conf import settings
from massmedia.models import VoxantVideo

register = template.Library()

class MassMediaNode(template.Node):
    def __init__(self, *args):
        assert len(args)
        self.args = list(args)
    
    def render(self, context):
        self.args[0] = context.get(self.args[0],self.args[0])
        if isinstance(self.args[0], basestring):
            self.args[0] = VoxantVideo.objects.get(asset_id=self.args[0])
        return self.args[0].get_template().render(template.RequestContext(context['request'], {
        'media':self.args[0],
    }))
def show_media(parser, token):
    return MassMediaNode(*token.contents.split()[1:])<commit_msg>changed lookup to slug<commit_after>from django import template
from django.conf import settings
from massmedia.models import VoxantVideo

register = template.Library()

class MassMediaNode(template.Node):
    def __init__(self, *args):
        assert len(args)
        self.args = list(args)
    
    def render(self, context):
        self.args[0] = context.get(self.args[0],self.args[0])
        if isinstance(self.args[0], basestring):
            self.args[0] = VoxantVideo.objects.get(slug=self.args[0])
        return self.args[0].get_template().render(template.RequestContext(context['request'], {
        'media':self.args[0],
    }))
def show_media(parser, token):
    return MassMediaNode(*token.contents.split()[1:])
{'fraction_non_alphanumeric': 0.13921433494141972, 'fraction_numerical': 0.012405237767057202, 'mean_word_length': 3.776315789473684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5700760', 'n_tokens_mistral': 447, 'n_tokens_neox': 444, 'n_words': 84}