<commit_before>from imagekit import ImageSpec, register
from imagekit.processors import ResizeToFit

from spectator.core import app_settings


class Thumbnail(ImageSpec):
    "Base class"
    format = "JPEG"
    options = {"quality": 60}


class ListThumbnail(Thumbnail):
    "For displaying in lists of Publications, Events, etc."
    processors = [ResizeToFit(*app_settings.LIST_THUMBNAIL_SIZE)]


register.generator("spectator:list_thumbnail", ListThumbnail)


class ListThumbnail2x(ListThumbnail):
    "Retina version of ListThumbnail"
    dimensions = [x * 2 for x in app_settings.LIST_THUMBNAIL_SIZE]
    processors = [ResizeToFit(*dimensions)]


register.generator("spectator:list_thumbnail2x", ListThumbnail2x)


class DetailThumbnail(Thumbnail):
    "For displaying on the detail pages of Publication, Event, etc"
    processors = [ResizeToFit(*app_settings.DETAIL_THUMBNAIL_SIZE)]


register.generator("spectator:detail_thumbnail", DetailThumbnail)


class DetailThumbnail2x(DetailThumbnail):
    "Retina version of DetailThumbnail"
    dimensions = [x * 2 for x in app_settings.DETAIL_THUMBNAIL_SIZE]
    processors = [ResizeToFit(*dimensions)]


register.generator("spectator:detail_thumbnail2x", DetailThumbnail2x)
<commit_msg>Tidy file<commit_after>from imagekit import ImageSpec, register
from imagekit.processors import ResizeToFit

from spectator.core import app_settings


class Thumbnail(ImageSpec):
    "Base class"
    format = "JPEG"
    options = {"quality": 60}


class ListThumbnail(Thumbnail):
    "For displaying in lists of Publications, Events, etc."
    processors = [ResizeToFit(*app_settings.LIST_THUMBNAIL_SIZE)]


class ListThumbnail2x(ListThumbnail):
    """Retina version of ListThumbnail
    Generated twice the size of our set dimensions.
    """

    dimensions = [d * 2 for d in app_settings.LIST_THUMBNAIL_SIZE]
    processors = [ResizeToFit(*dimensions)]


class DetailThumbnail(Thumbnail):
    "For displaying on the detail pages of Publication, Event, etc"
    processors = [ResizeToFit(*app_settings.DETAIL_THUMBNAIL_SIZE)]


class DetailThumbnail2x(DetailThumbnail):
    """Retina version of DetailThumbnail
    Generated twice the size of our set dimensions.
    """

    dimensions = [d * 2 for d in app_settings.DETAIL_THUMBNAIL_SIZE]
    processors = [ResizeToFit(*dimensions)]


register.generator("spectator:list_thumbnail", ListThumbnail)
register.generator("spectator:list_thumbnail2x", ListThumbnail2x)
register.generator("spectator:detail_thumbnail", DetailThumbnail)
register.generator("spectator:detail_thumbnail2x", DetailThumbnail2x)

{'fraction_non_alphanumeric': 0.08789514263685427, 'fraction_numerical': 0.007710100231303007, 'mean_word_length': 5.653846153846154, 'pattern_counts': {'":': 2, '<': 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': '226687', 'n_tokens_mistral': 867, 'n_tokens_neox': 829, 'n_words': 189}