class_docstr: Class determine the main operations for parameters search
  like finding all changing parameters.
  
  Args:
      prefix: prefix to determine special keys like "`prefix`_range", "`prefix`_bool", "`prefix`_choice"
      seed: random seed for initialization
      **kwargs: basic config with parameters
  
  Attributes:
      basic_config: dictionary with initial config with possible values of searched parameters
      prefix: prefix to determine special keys like "`prefix`_range", "`prefix`_bool", "`prefix`_choice"
      paths_to_params: list of lists of keys and/or integers (for list)
              with relative paths to searched parameters
      n_params: number of searched parameters
      eps: threshold value
docstr: 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
docstr_tok: ["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"]
code: 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
  
file_path: DeepPavlov/deeppavlov/core/common/params_search.py
imports: import random
  from copy import deepcopy
  from logging import getLogger
  from typing import List, Generator, Any, Tuple
  import numpy
  from deeppavlov.core.common.registry import register
label_desc: Use image node_id 7 for calling the ParamsSearch obj's underlying member method code with example usage: obj.sample_params() and returns: params_sample, dict