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
  provides the flexibility of component-specific determinism without
  affecting the global states.  It is recommended to use this API with
  :py:class:`monai.data.DataLoader` for deterministic behaviour of the
  preprocessing pipelines. This API is not thread-safe. Additionally,
  deepcopying instance of this class often causes insufficient randomness as
  the random states will be duplicated.
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","provides","the","flexibility","of","component-specific","determinism","without","affecting","the","global","states",".","It","is","recommended","to","use","this","API","with",":","py",":","class",":","`","monai.data.DataLoader","`","for","deterministic","behaviour","of","the","preprocessing","pipelines",".","This","API","is","not","thread-safe",".","Additionally",",","deepcopying","instance","of","this","class","often","causes","insufficient","randomness","as","the","random","states","will","be","duplicated","."]
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.
  
  Raises:
      NotImplementedError: When the subclass does not override this method.
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.
  
      Raises:
          NotImplementedError: When the subclass does not override this method.
      """
      raise NotImplementedError(
          f"Subclass {self.__class__.__name__} must implement this method."
      )
  
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 Randomizable obj's underlying member method code with example usage: obj.randomize(data) without return types