def get_random()

in eventdata/parameter_sources/weightedarray.py [0:0]


    def get_random(self):
        self._counter += 1
        if self._counter < WeightedArray.CUTOFF_FREQUENCY:
            self._top_idx = (self._top_idx + 1) % self._top_len
            return self._top_choices[self._top_idx]
        else:
            # Don't let this counter ever overflow. We're just interested in small counts anyway.
            self._counter = 0
            self._bottom_idx = (self._bottom_idx + 1) % self._bottom_len
            return self._bottom_choices[self._bottom_idx]