def sample_params(self, **params) -> dict:
        """
        Sample parameters according to the given possible values

        Args:
            **params: dictionary like {"param_0": {"`prefix`_range": [0, 10]},
                                       "param_1": {"`prefix`_range": [0, 10], "discrete": true},
                                       "param_2": {"`prefix`_range": [0, 1], "scale": "log"},
                                       "param_3": {"`prefix`_bool": true},
                                       "param_4": {"`prefix`_choice": [0, 1, 2, 3]}}

        Returns:
            dictionary with randomly sampled parameters
        """
        if not params:
            return {}
        else:
            params_copy = deepcopy(params)
        params_sample = dict()
        for param, param_val in params_copy.items():
            if isinstance(param_val, dict):
                if self.prefix + '_bool' in param_val and param_val[self.prefix + '_bool']:
                    sample = bool(random.choice([True, False]))
                elif self.prefix + '_range' in param_val:
                    sample = self._sample_from_ranges(param_val)
                elif self.prefix + '_choice' in param_val:
                    sample = random.choice(param_val[self.prefix + '_choice'])
                else:
                    sample = param_val
                params_sample[param] = sample
            else:
                params_sample[param] = params_copy[param]
        return params_sample

        Sample parameters according to the given possible values

        Args:
            **params: dictionary like {"param_0": {"`prefix`_range": [0, 10]},
                                       "param_1": {"`prefix`_range": [0, 10], "discrete": true},
                                       "param_2": {"`prefix`_range": [0, 1], "scale": "log"},
                                       "param_3": {"`prefix`_bool": true},
                                       "param_4": {"`prefix`_choice": [0, 1, 2, 3]}}

        Returns:
            dictionary with randomly sampled parameters
        
deeppavlov/core/common/params_search.py