<commit_before>"""
 Custom processors to pass variables to views rendering template tags 
 see http://www.djangobook.com/en/2.0/chapter09.html  
"""

from django.template import RequestContext
from django.conf import settings

from comicsite.views import getSite

def comic_site(request):
    """ Find out in which comic site this request is loaded. If you cannot
    figure it out. Use main project. 
    
    """
        
    from django.core.urlresolvers import resolve
    resolution = resolve(request.path)
        
    if resolution.kwargs.has_key("site_short_name"):
        sitename = resolution.kwargs["site_short_name"]
    elif resolution.kwargs.has_key("project_name"):
        sitename = resolution.kwargs["project_name"]
    else:
        sitename = settings.MAIN_PROJECT_NAME
    
    return {"site":getSite(sitename)}
        <commit_msg>extended context processer to now also include pages and footer links in every request<commit_after>"""
 Custom processors to pass variables to views rendering template tags 
 see http://www.djangobook.com/en/2.0/chapter09.html  
"""

from django.template import RequestContext
from django.conf import settings

from comicsite.views import site_get_standard_vars

def comic_site(request):
    """ Find out in which comic site this request is loaded. If you cannot
    figure it out. Use main project. 
    
    """
        
    from django.core.urlresolvers import resolve
    resolution = resolve(request.path)
        
    if resolution.kwargs.has_key("site_short_name"):
        sitename = resolution.kwargs["site_short_name"]
    elif resolution.kwargs.has_key("project_name"):
        sitename = resolution.kwargs["project_name"]
    else:
        sitename = settings.MAIN_PROJECT_NAME
    
    [site, pages, metafooterpages] = site_get_standard_vars(sitename)
    
    return {"site":site,"pages":pages,"metafooterpages":metafooterpages}
        
{'fraction_non_alphanumeric': 0.08656873032528856, 'fraction_numerical': 0.004197271773347324, 'mean_word_length': 3.4143518518518516, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2556395', 'n_tokens_mistral': 537, 'n_tokens_neox': 523, 'n_words': 149}