<commit_before>import os
from django import template

register = template.Library()

@register.filter('join_path')
def join_path(value, path):
  return os.path.join(value, path)

@register.filter('is_file')
def is_file(value, basedir):
  return os.path.isfile(os.path.join(basedir, value))

@register.filter('is_dir')
def is_dir(value, basedir):
  return os.path.isdir(os.path.join(basedir, value))

@register.filter('get_directory_by_sipuuid')
def get_directory_by_sipuuid(value):
  from dashboard.dashboard.models import Job
  import re
  directory = Job.objects.all().filter(sipuuid = value)[0].directory
  return re.search(r'^.*/(?P<directory>.*)-[\w]{8}(-[\w]{4}){3}-[\w]{12}$', directory).group('directory')

@register.filter('get_jobs_by_sipuuid')
def get_jobs_by_sipuuid(value):
  from dashboard.dashboard.models import Job
  jobs = Job.objects.all().filter(sipuuid = value).order_by('-createdtime')<commit_msg>Fix paths to modules.<commit_after>import os
from django import template

register = template.Library()

@register.filter('join_path')
def join_path(value, path):
  return os.path.join(value, path)

@register.filter('is_file')
def is_file(value, basedir):
  return os.path.isfile(os.path.join(basedir, value))

@register.filter('is_dir')
def is_dir(value, basedir):
  return os.path.isdir(os.path.join(basedir, value))

@register.filter('get_directory_by_sipuuid')
def get_directory_by_sipuuid(value):
  from dashboard.main.models import Job
  import re
  directory = Job.objects.all().filter(sipuuid = value)[0].directory
  return re.search(r'^.*/(?P<directory>.*)-[\w]{8}(-[\w]{4}){3}-[\w]{12}$', directory).group('directory')

@register.filter('get_jobs_by_sipuuid')
def get_jobs_by_sipuuid(value):
  from dashboard.main.models import Job
  jobs = Job.objects.all().filter(sipuuid = value).order_by('-createdtime')
{'fraction_non_alphanumeric': 0.16830065359477125, 'fraction_numerical': 0.006535947712418301, 'mean_word_length': 6.377510040160643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6263196', 'n_tokens_mistral': 658, 'n_tokens_neox': 643, 'n_words': 110}