class_docstr: Perturb parameters for exploration
  
  Given a set of parameter values, this exploration object randomly perturb
  them with a given ``factor``. It will multiply the value of a dimension
  with probability 0.5, otherwise divide it. Values are clamped to limits of the
  search space when exceeding it. For categorical dimensions, a new value is sampled
  from categories with equal probability for each categories.
  
  Parameters
  ----------
  factor: float, optional
      Factor used to multiply or divide with probability 0.5 the values of the dimensions.
      Only applies to real or int dimensions. Integer dimensions are pushed to next integer
      if ``new_value > value`` otherwise reduced to previous integer, where new_value is
      the result of either ``value * factor`` or ``value / factor``.
      Categorial dimensions are sampled from categories randomly. Default: 1.2
  volatility: float, optional
      If the results of ``value * factor`` or ``value / factor`` exceeds the
      limit of the search space, the new value is set to limit and then added
      or subtracted ``abs(normal(0, volatility))`` (if at lower limit or upper limit).
      Default: 0.0001
  
  Notes
  -----
  Categorical dimensions with special probabilities are not supported for now. A category
  with be sampled with equal probability for each categories.
docstr: Perturb categorical dimension
  
  Parameters
  ----------
  rng: numpy.random.Generator
      Random number generator
  dim_value: object
      Value of the dimension, can be any type.
  dim: orion.algo.space.CategoricalDimension
      CategoricalDimension object defining the search space for this dimension.
docstr_tok: ["Perturb","categorical","dimension","Parameters","--","--","--","--","--","rng",":","numpy.random.Generator","Random","number","generator","dim_value",":","object","Value","of","the","dimension",",","can","be","any","type",".","dim",":","orion.algo.space.CategoricalDimension","CategoricalDimension","object","defining","the","search","space","for","this","dimension","."]
code: def perturb_cat(self, rng, dim_value, dim):
      """Perturb categorical dimension
  
      Parameters
      ----------
      rng: numpy.random.Generator
          Random number generator
      dim_value: object
          Value of the dimension, can be any type.
      dim: orion.algo.space.CategoricalDimension
          CategoricalDimension object defining the search space for this dimension.
  
      """
      # NOTE: Can't use rng.choice otherwise the interval is an array of strings
      #       and the value is casted.
      choices = dim.interval()
      choice = choices[rng.randint(len(choices))]
      return choice
  
imports: import numpy
  from orion.core.utils import GenericFactory
  from orion.core.utils.flatten import flatten, unflatten
label_desc: Use image node_id 4 for calling the PerturbExplore obj's underlying member method code with example usage: obj.perturb_cat(rng, dim_value, dim) and returns: choice