<commit_before>import logging

from mongoengine import Document
from mongoengine import StringField, IntField

from django.conf import settings

from crits.core.crits_mongoengine import CritsDocument, CritsSchemaDocument

logger = logging.getLogger(__name__)

class Sector(CritsDocument, CritsSchemaDocument, Document):
    """
    CRITs Sector Class
    """

    meta = {
        "collection": settings.COL_SECTOR_LISTS,
        "crits_type": 'Sectorlist',
        "latest_schema_version": 1,
        "schema_doc": {
            'name': 'Sectorlist name',
            'Actor': 'Integer',
            'Backdoor': 'Integer',
            'Campaign': 'Integer',
            'Certificate': 'Integer',
            'Domain': 'Integer',
            'Email': 'Integer',
            'Event': 'Integer',
            'Exploit': 'Integer',
            'Target': 'Integer',
            'Event': 'Integer',
            'IP': 'Integer',
            'Indicator': 'Integer',
            'PCAP': 'Integer',
            'RawData': 'Integer',
            'Sample': 'Integer'
        },
    }

    name = StringField(required=True)
    Actor = IntField(default=0)
    Backdoor = IntField(default=0)
    Campaign = IntField(default=0)
    Certificate = IntField(default=0)
    Domain = IntField(default=0)
    Email = IntField(default=0)
    Event = IntField(default=0)
    Exploit = IntField(default=0)
    Indicator = IntField(default=0)
    IP = IntField(default=0)
    PCAP = IntField(default=0)
    RawData = IntField(default=0)
    Sample = IntField(default=0)
    Target = IntField(default=0)

    def migrate(self):<commit_msg>Remove duplicate key from schema_doc.<commit_after>import logging

from mongoengine import Document
from mongoengine import StringField, IntField

from django.conf import settings

from crits.core.crits_mongoengine import CritsDocument, CritsSchemaDocument

logger = logging.getLogger(__name__)

class Sector(CritsDocument, CritsSchemaDocument, Document):
    """
    CRITs Sector Class
    """

    meta = {
        "collection": settings.COL_SECTOR_LISTS,
        "crits_type": 'Sectorlist',
        "latest_schema_version": 1,
        "schema_doc": {
            'name': 'Sectorlist name',
            'Actor': 'Integer',
            'Backdoor': 'Integer',
            'Campaign': 'Integer',
            'Certificate': 'Integer',
            'Domain': 'Integer',
            'Email': 'Integer',
            'Event': 'Integer',
            'Exploit': 'Integer',
            'Target': 'Integer',
            'IP': 'Integer',
            'Indicator': 'Integer',
            'PCAP': 'Integer',
            'RawData': 'Integer',
            'Sample': 'Integer'
        },
    }

    name = StringField(required=True)
    Actor = IntField(default=0)
    Backdoor = IntField(default=0)
    Campaign = IntField(default=0)
    Certificate = IntField(default=0)
    Domain = IntField(default=0)
    Email = IntField(default=0)
    Event = IntField(default=0)
    Exploit = IntField(default=0)
    Indicator = IntField(default=0)
    IP = IntField(default=0)
    PCAP = IntField(default=0)
    RawData = IntField(default=0)
    Sample = IntField(default=0)
    Target = IntField(default=0)

    def migrate(self):
{'fraction_non_alphanumeric': 0.12585456805469236, 'fraction_numerical': 0.009322560596643879, 'mean_word_length': 2.584632516703786, 'pattern_counts': {'":': 8, '<': 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': '6846012', 'n_tokens_mistral': 967, 'n_tokens_neox': 944, 'n_words': 205}