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 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
docstr_tok: ["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"]
code: 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
  
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 8 for calling the ParamsSearch obj's underlying member method code with example usage: obj._sample_from_ranges(opts) and returns: sample