<commit_before>from django.db import models
from .files import ProcessedImageFieldFile
from .utils import ImageSpecFileDescriptor
from ...specs import SpecHost
from ...specs.sourcegroups import ImageFieldSourceGroup
from ...registry import register


class SpecHostField(SpecHost):
    def set_spec_id(self, cls, name):
        # Generate a spec_id to register the spec with. The default spec id is
        # "<app>:<model>_<field>"
        if not getattr(self, 'spec_id', None):
            spec_id = (u'%s:%s_%s' % (cls._meta.app_label,
                            cls._meta.object_name, name)).lower()

            # Register the spec with the id. This allows specs to be overridden
            # later, from outside of the model definition.
            super(SpecHostField, self).set_spec_id(spec_id)


class ImageSpecField(SpecHostField):
    """
    The heart and soul of the ImageKit library, ImageSpecField allows you to add
    variants of uploaded images to your models.

    """<commit_msg>Always use colon as segment separator<commit_after>from django.db import models
from .files import ProcessedImageFieldFile
from .utils import ImageSpecFileDescriptor
from ...specs import SpecHost
from ...specs.sourcegroups import ImageFieldSourceGroup
from ...registry import register


class SpecHostField(SpecHost):
    def set_spec_id(self, cls, name):
        # Generate a spec_id to register the spec with. The default spec id is
        # "<app>:<model>_<field>"
        if not getattr(self, 'spec_id', None):
            spec_id = (u'%s:%s:%s' % (cls._meta.app_label,
                            cls._meta.object_name, name)).lower()

            # Register the spec with the id. This allows specs to be overridden
            # later, from outside of the model definition.
            super(SpecHostField, self).set_spec_id(spec_id)


class ImageSpecField(SpecHostField):
    """
    The heart and soul of the ImageKit library, ImageSpecField allows you to add
    variants of uploaded images to your models.

    """
{'fraction_non_alphanumeric': 0.08538993089832182, 'fraction_numerical': 0.0, 'mean_word_length': 2.958984375, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1192284', 'n_tokens_mistral': 563, 'n_tokens_neox': 548, 'n_words': 199}