def _sample_from_ranges(self, opts: dict) -> [int, float]:
        """
        Sample parameters from ranges

        Args:
            opts: dictionary  {"`prefix`_range": [0, 10]} or \
                              {"`prefix`_range": [0, 10], "discrete": true} or \
                              {"`prefix`_range": [0, 1], "scale": "log"}

        Returns:
            random parameter value from range
        """
        from_ = opts[self.prefix + '_range'][0]
        to_ = opts[self.prefix + '_range'][1]
        if opts.get('scale', None) == 'log':
            sample = self._sample_log(from_, to_)
        else:
            sample = np.random.uniform(from_, to_)
        if opts.get('discrete', False):
            sample = int(np.round(sample))
        return sample

        Sample parameters from ranges

        Args:
            opts: dictionary  {"`prefix`_range": [0, 10]} or                               {"`prefix`_range": [0, 10], "discrete": true} or                               {"`prefix`_range": [0, 1], "scale": "log"}

        Returns:
            random parameter value from range
        
deeppavlov/core/common/params_search.py