class_docstr: Class providing the core functionality of a parameter, aka
  value, internal/model parameters, mutation, recombination
  and additional features such as shared random state,
  constraint check, hashes, generation and naming.
  The value field should sent to the function to optimize.
  
  Example
  -------
  >>> ng.p.Array(shape=(2,)).value
  array([0., 0.])
docstr: Creates a new instance which shares the same random generator than its parent,
  is sampled from the same data, and mutates independently from the parentp.
  If a new value is provided, it will be set to the new instance
  
  Parameters
  ----------
  new_value: anything (optional)
      if provided, it will update the new instance value (cannot be used at the same time as new_data).
  
  Returns
  -------
  Parameter
      a new instance of the same class, with same content/internal-model parameters/...
      Optionally, a new value will be set after creation
docstr_tok: ["Creates","a","new","instance","which","shares","the","same","random","generator","than","its","parent",",","is","sampled","from","the","same","data",",","and","mutates","independently","from","the","parentp",".","If","a","new","value","is","provided",",","it","will","be","set","to","the","new","instance","Parameters","--","--","--","--","--","new_value",":","anything","(","optional",")","if","provided",",","it","will","update","the","new","instance","value","(","can","not","be","used","at","the","same","time","as","new_data",")",".","Returns","--","--","--","-","Parameter","a","new","instance","of","the","same","class",",","with","same","content\/internal-model","parameters\/","...","Optionally",",","a","new","value","will","be","set","after","creation"]
code: def spawn_child(self: P, new_value: tp.Optional[tp.Any] = None) -> P:
      """Creates a new instance which shares the same random generator than its parent,
      is sampled from the same data, and mutates independently from the parentp.
      If a new value is provided, it will be set to the new instance
  
      Parameters
      ----------
      new_value: anything (optional)
          if provided, it will update the new instance value (cannot be used at the same time as new_data).
  
      Returns
      -------
      Parameter
          a new instance of the same class, with same content/internal-model parameters/...
          Optionally, a new value will be set after creation
      """
      # make sure to initialize the random state  before spawning children
      self.random_state  # pylint: disable=pointless-statement
      child = self.copy()
      child._set_parenthood(self)
      if new_value is not None:
          child.value = new_value
      return child
  
imports: import uuid
  import warnings
  import numpy
  import nevergrad.common.typing
  from nevergrad.common import errors
  from .None import utils
  from ._layering import ValueProperty
  from ._layering import Layered
  from ._layering import Level
label_desc: Use image node_id 24 for calling the Parameter obj's underlying member method code with example usage: obj.spawn_child(new_value) and returns: child