def sample_params(self, **params) -> dict:
if not params:<EOL><INDENT>return {}<EOL><DEDENT>else:<EOL><INDENT>params_copy = deepcopy(params)<EOL><DEDENT>params_sample = dict()<EOL>for param, param_val in params_copy.items():<EOL><INDENT>if isinstance(param_val, dict):<EOL><INDENT>if self.prefix + '<STR_LIT>' in param_val and param_val[self.prefix + '<STR_LIT>']:<EOL><INDENT>sample = bool(random.choice([True, False]))<EOL><DEDENT>elif self.prefix + '<STR_LIT>' in param_val:<EOL><INDENT>sample = self._sample_from_ranges(param_val)<EOL><DEDENT>elif self.prefix + '<STR_LIT>' in param_val:<EOL><INDENT>sample = random.choice(param_val[self.prefix + '<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>sample = param_val<EOL><DEDENT>params_sample[param] = sample<EOL><DEDENT>else:<EOL><INDENT>params_sample[param] = params_copy[param]<EOL><DEDENT><DEDENT>return params_sample<EOL>
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