<commit_before># -*- coding: utf-8 -*-
from cms.models import CMSPlugin, force_text, Page
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.image import FilerImageField


class Carousel(CMSPlugin):
    """
    Model for storing carousel meta data and configuration.
    """
    name = models.CharField(
        verbose_name=_("name"),
        max_length=160,
    )
    interval = models.FloatField(
        verbose_name=_("slide changing time in seconds"),
        default=5.0,
    )

    def __str__(self):
        return "%s" % self.name

    def copy_relations(self, oldinstance):
        """
        Make a copy of the related slides for the new carousel object.<commit_msg>Add interval property to Carousel to ease template designing<commit_after># -*- coding: utf-8 -*-
from cms.models import CMSPlugin, force_text, Page
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.image import FilerImageField


class Carousel(CMSPlugin):
    """
    Model for storing carousel meta data and configuration.
    """
    name = models.CharField(
        verbose_name=_("name"),
        max_length=160,
    )
    interval = models.FloatField(
        verbose_name=_("slide changing time in seconds"),
        default=5.0,
    )

    def __str__(self):
        return "%s" % self.name

    @property
    def interval_in_ms(self):
        """
        The slide change interval in milliseconds
        :rtype: int
        """
        return int(self.interval * 1000)

    def copy_relations(self, oldinstance):
        """
        Make a copy of the related slides for the new carousel object.
{'fraction_non_alphanumeric': 0.09354647720544701, 'fraction_numerical': 0.009473060982830076, 'mean_word_length': 2.7555555555555555, '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': '6321021', 'n_tokens_mistral': 492, 'n_tokens_neox': 469, 'n_words': 149}