class_docstr: An interface for handling random state locally, currently based on a class variable `R`,
  which is an instance of `np.random.RandomState`.
  This class introduces a randomized flag `_do_transform`, is mainly for randomized data augmentation transforms.
  For example:
  
  .. code-block:: python
  
      from monai.transforms import RandomizableTransform
  
      class RandShiftIntensity100(RandomizableTransform):
          def randomize(self):
              super().randomize(None)
              self._offset = self.R.uniform(low=0, high=100)
  
          def __call__(self, img):
              self.randomize()
              if not self._do_transform:
                  return img
              return img + self._offset
  
      transform = RandShiftIntensity()
      transform.set_random_state(seed=0)
      print(transform(10))
class_docstr_tok: ["An","interface","for","handling","random","state","locally",",","currently","based","on","a","class","variable","`","R","`",",","which","is","an","instance","of","`","np.random.RandomState","`",".","This","class","introduces","a","randomized","flag","`","_do_transform","`",",","is","mainly","for","randomized","data","augmentation","transforms",".","For","example",":","..","code-block",":",":","python","from","monai.transforms","import","RandomizableTransform","class","RandShiftIntensity100","(","RandomizableTransform",")",":","def","randomize","(","self",")",":","super","(",")",".randomize","(","None",")","self._offset","=","self.R.uniform","(","low=0",",","high=100",")","def","__call__","(","self",",","img",")",":","self.randomize","(",")","if","not","self._do_transform",":","return","img","return","img","+","self._offset","transform","=","RandShiftIntensity","(",")","transform.set_random_state","(","seed=0",")","print","(","transform","(","10",")",")"]
docstr: Within this method, :py:attr:`self.R` should be used, instead of `np.random`, to introduce random factors.
  
  all :py:attr:`self.R` calls happen here so that we have a better chance to
  identify errors of sync the random state.
  
  This method can generate the random factors based on properties of the input data.
code: def randomize(self, data: Any) -> None:
      """
      Within this method, :py:attr:`self.R` should be used, instead of `np.random`, to introduce random factors.
  
      all :py:attr:`self.R` calls happen here so that we have a better chance to
      identify errors of sync the random state.
  
      This method can generate the random factors based on properties of the input data.
      """
      self._do_transform = self.R.rand() < self.prob
  
imports: from __future__ import annotations
  import logging
  from abc import ABC, abstractmethod
  from collections.abc import Callable, Generator, Hashable, Iterable, Mapping
  from typing import Any, TypeVar
  import numpy
  import torch
  from monai import config, transforms
  from monai.config import KeysCollection
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms.traits import LazyTrait, RandomizableTrait, ThreadUnsafe
  from monai.utils import MAX_SEED, ensure_tuple, first
  from monai.utils.enums import TransformBackends
  from monai.utils.misc import MONAIEnvVars
label_desc: Use image node_id 2 for calling the RandomizableTransform obj's underlying member method code with example usage: obj.randomize(data) without return types