<commit_before>from __future__ import print_function, absolute_import, division, unicode_literals

from ..libs import *
from .base import Widget


class ProgressBar(Widget):
    def __init__(self, max=None, value=None, **style):
        super(ProgressBar, self).__init__(**style)
        self.max = max

        self.startup()

        self.value = value

    def startup(self):
        self._impl = NSProgressIndicator.new()
        self._impl.setStyle_(NSProgressIndicatorBarStyle)
        self._impl.setDisplayedWhenStopped_(False)
        if self.max:
            self._impl.setIndeterminate_(False)
            self._impl.setMaxValue_(self.max)
        else:
            self._impl.setIndeterminate_(True)

        # Disable all autolayout functionality
        self._impl.setTranslatesAutoresizingMaskIntoConstraints_(False)
        self._impl.setAutoresizesSubviews_(False)

    @property
    def value(self):
        return self._value

    @value.setter<commit_msg>Make progress bar visible by default.<commit_after>from __future__ import print_function, absolute_import, division, unicode_literals

from ..libs import *
from .base import Widget


class ProgressBar(Widget):
    def __init__(self, max=None, value=None, **style):
        super(ProgressBar, self).__init__(**style)
        self.max = max

        self.startup()

        self.value = value

    def startup(self):
        self._impl = NSProgressIndicator.new()
        self._impl.setStyle_(NSProgressIndicatorBarStyle)
        self._impl.setDisplayedWhenStopped_(True)
        if self.max:
            self._impl.setIndeterminate_(False)
            self._impl.setMaxValue_(self.max)
        else:
            self._impl.setIndeterminate_(True)

        # Disable all autolayout functionality
        self._impl.setTranslatesAutoresizingMaskIntoConstraints_(False)
        self._impl.setAutoresizesSubviews_(False)

    @property
    def value(self):
        return self._value

    @value.setter
{'fraction_non_alphanumeric': 0.08777270421106037, 'fraction_numerical': 0.0, 'mean_word_length': 2.8590998043052838, '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': '6795097', 'n_tokens_mistral': 570, 'n_tokens_neox': 553, 'n_words': 108}