<commit_before>import datetime

from dictshield.base import ShieldException
from dictshield.document import Document, EmbeddedDocument

from dictshield.fields import (BaseField,
                               IntField,
                               BooleanField,
                               StringField,
                               FloatField,
                               DateTimeField,
                               EmailField,
                               MD5Field)

from dictshield.fields.compound import ListField, EmbeddedDocumentField
from dictshield.fields.mongo import ObjectIdField
import hashlib
import json

###
### Basic Class and Subclass
###

class SimpleDoc(Document):
    """Simple document that has one StringField member
    """
    owner = ObjectIdField() # probably set required=True
    title = StringField(max_length=40)


simple_doc = SimpleDoc(title='Misc Doc')


class SubDoc(SimpleDoc):
    """Subclass of `SimpleDoc`. Adds `year` and limits publicly shareable
    fields to only 'title' and 'year'.
    """
    _public_fields = ['title','year']
    year = IntField(min_value=1950, max_value=datetime.datetime.now().year)
    thoughts = StringField(max_length=255)


sub_doc = SubDoc(title='Total Recall',
                 year=1990,
                 thoughts='I wish I had three hands...')

###
### Mixin Docs
###

class InterestMixin(EmbeddedDocument):
    liked = BooleanField(default=False)
    archived = BooleanField(default=False)
    deleted = BooleanField(default=False)
    meta = {
        'mixin': True,
    }


class MixedDoc(Document, InterestMixin):
    title = StringField()
    body = StringField()


mixed_doc = MixedDoc()
mixed_doc.title = 'Mixed Document'
mixed_doc.body = """Scenester twee mlkshk readymade butcher. Letterpress
portland +1 salvia, vinyl trust fund butcher gentrify farm-to-table brooklyn
helvetica DIY. Sartorial homo 3 wolf moon, banh mi blog retro mlkshk Austin
master cleanse.
"""<commit_msg>Updated tests to work on the new metaclass structure<commit_after>import datetime

from dictshield.base import ShieldException
from dictshield.document import Document, EmbeddedDocument

from dictshield.fields import (BaseField,
                               IntField,
                               BooleanField,
                               StringField,
                               FloatField,
                               DateTimeField,
                               EmailField,
                               MD5Field)

from dictshield.fields.compound import ListField, EmbeddedDocumentField
from dictshield.fields.mongo import ObjectIdField
import hashlib
import json

###
### Basic Class and Subclass
###

class SimpleDoc(Document):
    """Simple document that has one StringField member
    """
    owner = ObjectIdField() # probably set required=True
    title = StringField(max_length=40)


simple_doc = SimpleDoc(title='Misc Doc')


class SubDoc(SimpleDoc):
    """Subclass of `SimpleDoc`. Adds `year` and limits publicly shareable
    fields to only 'title' and 'year'.
    """
    _public_fields = ['title','year']
    year = IntField(min_value=1950, max_value=datetime.datetime.now().year)
    thoughts = StringField(max_length=255)


sub_doc = SubDoc(title='Total Recall',
                 year=1990,
                 thoughts='I wish I had three hands...')

###
### Mixin Docs
###

class InterestMixin(EmbeddedDocument):
    liked = BooleanField(default=False)
    archived = BooleanField(default=False)
    deleted = BooleanField(default=False)
    class Meta:
        mixin = True


class MixedDoc(Document, InterestMixin):
    title = StringField()
    body = StringField()


mixed_doc = MixedDoc()
mixed_doc.title = 'Mixed Document'
mixed_doc.body = """Scenester twee mlkshk readymade butcher. Letterpress
portland +1 salvia, vinyl trust fund butcher gentrify farm-to-table brooklyn
helvetica DIY. Sartorial homo 3 wolf moon, banh mi blog retro mlkshk Austin
master cleanse.
"""
{'fraction_non_alphanumeric': 0.08672699849170437, 'fraction_numerical': 0.008044243338360985, 'mean_word_length': 2.657169117647059, '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': '7012660', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1059, 'n_words': 307}