<commit_before>import os
import jinja2 as jinja

DEFAULT_THEME = 'default'

def create_env():
    path = os.path.abspath('.')
    loader = jinja.FileSystemLoader(path)
    env = jinja.Environment(loader=loader)
    return env
    
def render(theme, item, context=None):
    reldir = 'themes/%s' % theme
    absdir = os.path.abspath(reldir)
    context = context or {}
    context['item'] = item
    context['feed'] = item.feed
    context['reldir'] = reldir
    context['absdir'] = absdir
    try:
        template = 'themes/%s/index.html' % theme
        template = env.get_template(template)
        return template.render(context)
    except Exception:
        if theme == DEFAULT_THEME:
            raise
        return render(DEFAULT_THEME, item, context)
        
env = create_env()
<commit_msg>cssdir added<commit_after>import os
import jinja2 as jinja

DEFAULT_THEME = 'default'

def create_env():
    path = os.path.abspath('.')
    loader = jinja.FileSystemLoader(path)
    env = jinja.Environment(loader=loader)
    return env
    
def render(theme, item, context=None):
    reldir = 'themes/%s' % theme
    absdir = os.path.abspath(reldir)
    cssdir = 'file:///%s' % absdir.replace('\\', '/')
    context = context or {}
    context['item'] = item
    context['feed'] = item.feed
    context['reldir'] = reldir
    context['absdir'] = absdir
    context['cssdir'] = cssdir
    try:
        template = 'themes/%s/index.html' % theme
        template = env.get_template(template)
        return template.render(context)
    except Exception:
        if theme == DEFAULT_THEME:
            raise
        return render(DEFAULT_THEME, item, context)
        
env = create_env()

{'fraction_non_alphanumeric': 0.12199312714776632, 'fraction_numerical': 0.001145475372279496, 'mean_word_length': 2.452569169960474, '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': '1399614', 'n_tokens_mistral': 581, 'n_tokens_neox': 544, 'n_words': 122}