<commit_before>import logging

from mopidy import listeners, settings

logger = logging.getLogger('mopdy.mixers')

class BaseMixer(object):
    """
    **Settings:**

    - :attr:`mopidy.settings.MIXER_MAX_VOLUME`
    """

    amplification_factor = settings.MIXER_MAX_VOLUME / 100.0

    @property
    def volume(self):
        """
        The audio volume

        Integer in range [0, 100]. :class:`None` if unknown. Values below 0 is
        equal to 0. Values above 100 is equal to 100.
        """
        if not hasattr(self, '_user_volume'):
            self._user_volume = 0
        volume = self.get_volume()
        if volume is None:
            return None
        elif not self.amplification_factor < 1:
            return volume
        else:
            user_volume = int(volume / self.amplification_factor)
            if (user_volume - 1) <= self._user_volume <= (user_volume + 1):
                return self._user_volume
            else:
                return user_volume

    @volume.setter
    def volume(self, volume):
        if not hasattr(self, '_user_volume'):
            self._user_volume = 0
        volume = int(volume)
        if volume < 0:
            volume = 0
        elif volume > 100:
            volume = 100
        self._user_volume = volume
        real_volume = int(volume * self.amplification_factor)
        self.set_volume(real_volume)
        self._trigger_volume_changed()

    def get_volume(self):
        """
        Return volume as integer in range [0, 100]. :class:`None` if unknown.

        *MUST be implemented by subclass.*
        """
        raise NotImplementedError

    def set_volume(self, volume):
        """
        Set volume as integer in range [0, 100].

        *MUST be implemented by subclass.*
        """
        raise NotImplementedError

    def _trigger_volume_changed(self):
        logger.debug(u'Triggering volume changed event')
        listeners.BackendListener.send('volume_changed')
<commit_msg>Fix error in logger name<commit_after>import logging

from mopidy import listeners, settings

logger = logging.getLogger('mopidy.mixers')

class BaseMixer(object):
    """
    **Settings:**

    - :attr:`mopidy.settings.MIXER_MAX_VOLUME`
    """

    amplification_factor = settings.MIXER_MAX_VOLUME / 100.0

    @property
    def volume(self):
        """
        The audio volume

        Integer in range [0, 100]. :class:`None` if unknown. Values below 0 is
        equal to 0. Values above 100 is equal to 100.
        """
        if not hasattr(self, '_user_volume'):
            self._user_volume = 0
        volume = self.get_volume()
        if volume is None:
            return None
        elif not self.amplification_factor < 1:
            return volume
        else:
            user_volume = int(volume / self.amplification_factor)
            if (user_volume - 1) <= self._user_volume <= (user_volume + 1):
                return self._user_volume
            else:
                return user_volume

    @volume.setter
    def volume(self, volume):
        if not hasattr(self, '_user_volume'):
            self._user_volume = 0
        volume = int(volume)
        if volume < 0:
            volume = 0
        elif volume > 100:
            volume = 100
        self._user_volume = volume
        real_volume = int(volume * self.amplification_factor)
        self.set_volume(real_volume)
        self._trigger_volume_changed()

    def get_volume(self):
        """
        Return volume as integer in range [0, 100]. :class:`None` if unknown.

        *MUST be implemented by subclass.*
        """
        raise NotImplementedError

    def set_volume(self, volume):
        """
        Set volume as integer in range [0, 100].

        *MUST be implemented by subclass.*
        """
        raise NotImplementedError

    def _trigger_volume_changed(self):
        logger.debug(u'Triggering volume changed event')
        listeners.BackendListener.send('volume_changed')

{'fraction_non_alphanumeric': 0.09100050276520864, 'fraction_numerical': 0.01860231271995978, 'mean_word_length': 2.012112036336109, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, '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': '6305236', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1086, 'n_words': 310}