def localize_random_state_(self, recursive=True):
if self.random_state == ia.current_random_state():<EOL><INDENT>self.random_state = ia.new_random_state()<EOL><DEDENT>if recursive:<EOL><INDENT>for lst in self.get_children_lists():<EOL><INDENT>for child in lst:<EOL><INDENT>child.localize_random_state_(recursive=recursive)<EOL><DEDENT><DEDENT><DEDENT>return self<EOL>
Converts global random states to local ones.

A global random state exists exactly once. Many augmenters can point
to it (and thereby use it to sample random numbers).
Local random states usually exist for exactly one augmenter and are
saved within that augmenter.

Usually there is no need to change global into local random states.
The only noteworthy exceptions are

    * whenever you want to use determinism (so that the global random
      state is not accidentally reverted)
    * whenever you want to copy random states from one augmenter to
      another. (Copying the global random state doesn't help very
      much. If you copy the state from A to B, then execute A and then
      B, B's (global) random state has already changed because of A's
      sampling.)

The case of determinism is handled automatically by
:func:`imgaug.augmenters.meta.Augmenter.to_deterministic`.
Only when you copy random states (via :func:`imgaug.augmenters.meta.Augmenter.copy_random_state`),
you need to call this function first.

Parameters
----------
recursive : bool, optional
    Whether to localize the random states of children too.

Returns
-------
self : imgaug.augmenters.meta.Augmenter
    Returns itself (with localized random states).