<commit_before>from datetime import datetime
from os import path

from django.template.defaultfilters import slugify
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.conf import settings




from ella.db import fields
from ella.core.box import Box
from ella.photos.models import Photo
from ella.db.models import Publishable
from ella.core.models import Author, Source, Category

from nc.cdnclient.models import MediaField
from nc.cdnclient.files import Thumb



class RelaxXMLField(fields.XMLField):
    def get_schema_content(self, instance):
        fp = open("%s/relaxng.xml" % path.dirname(__file__), 'r')
        schema = fp.read()
        fp.close()
        return schema

class MetadataXMLField(fields.XMLField):
    def get_schema_content(self, instance):
        return instance.type.metadata_schema





class MediaBox(Box):
    def get_context(self):
        "Updates box context with media-specific variables."
        cont = super(MediaBox, self).get_context()
        cont.update({<commit_msg>- Removed XML fields from models - Removed bad import<commit_after>from datetime import datetime
from os import path

from django.template.defaultfilters import slugify
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.conf import settings




from ella.db import fields
from ella.core.box import Box
from ella.photos.models import Photo
from ella.db.models import Publishable
from ella.core.models import Author, Source, Category

from nc.cdnclient.models import MediaField

class MediaBox(Box):
    def get_context(self):
        "Updates box context with media-specific variables."
        cont = super(MediaBox, self).get_context()
        cont.update({
{'fraction_non_alphanumeric': 0.07092960773777539, 'fraction_numerical': 0.0, 'mean_word_length': 4.129476584022038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '2807433', 'n_tokens_mistral': 516, 'n_tokens_neox': 494, 'n_words': 170}