class_docstr: Class defining mutations, and holding a random state used for random generation.
class_docstr_tok: ["Class","defining","mutations",",","and","holding","a","random","state","used","for","random","generation","."]
docstr: Good old one-variable mutation.
  
  Parameters
  ----------
  parent: array-like
      the point to mutate
  arity: int
      the number of possible distinct values
docstr_tok: ["Good","old","one-variable","mutation",".","Parameters","--","--","--","--","--","parent",":","array-like","the","point","to","mutate","arity",":","int","the","number","of","possible","distinct","values"]
code: def rls_mutation(
      self, parent: tp.ArrayLike, arity: int = 2
  ) -> tp.ArrayLike:
      """Good old one-variable mutation.
  
      Parameters
      ----------
      parent: array-like
          the point to mutate
      arity: int
          the number of possible distinct values
      """
      dimension = len(parent)
      if dimension == 1:  # corner case.
          return self.random_state.normal(0.0, 1.0, size=1)  # type: ignore
      out = np.array(parent, copy=True)
      ind = self.random_state.randint(dimension)
      out[ind] = self.significantly_mutate(out[ind], arity)
      return out
  
file_path: nevergrad/nevergrad/optimization/mutations.py
imports: import numpy
  import nevergrad.common.typing
  from nevergrad.parametrization import discretization
  from .None import utils
label_desc: Use image node_id 5 for calling the Mutator obj's underlying member method code with example usage: obj.rls_mutation(parent, arity) and returns: out, self