class_docstr: ``OneOf`` provides the ability to randomly choose one transform out of a
  list of callables with pre-defined probabilities for each.
  
  Args:
      transforms: sequence of callables.
      weights: probabilities corresponding to each callable in transforms.
          Probabilities are normalized to sum to one.
      map_items: whether to apply transform to each item in the input `data` if `data` is a list or tuple.
          defaults to `True`.
      unpack_items: whether to unpack input `data` with `*` as parameters for the callable function of transform.
          defaults to `False`.
      log_stats: this optional parameter allows you to specify a logger by name for logging of pipeline execution.
          Setting this to False disables logging. Setting it to True enables logging to the default loggers.
          Setting a string overrides the logger name to which logging is performed.
      lazy: whether to enable :ref:`Lazy Resampling<lazy_resampling>` for lazy transforms. If False, transforms will
          be carried out on a transform by transform basis. If True, all lazy transforms will be executed by
          accumulating changes and resampling as few times as possible. If lazy is None, `Compose` will
          perform lazy execution on lazy transforms that have their `lazy` property set to True.
      overrides: this optional parameter allows you to specify a dictionary of parameters that should be overridden
          when executing a pipeline. These each parameter that is compatible with a given transform is then applied
          to that transform before it is executed. Note that overrides are currently only applied when
          :ref:`Lazy Resampling<lazy_resampling>` is enabled for the pipeline or a given transform. If lazy is False
          they are ignored. Currently supported args are:
          {``"mode"``, ``"padding_mode"``, ``"dtype"``, ``"align_corners"``, ``"resample_mode"``, ``device``}.
class_docstr_tok: ["``","OneOf","``","provides","the","ability","to","randomly","choose","one","transform","out","of","a","list","of","callables","with","pre-defined","probabilities","for","each",".","Args",":","transforms",":","sequence","of","callables",".","weights",":","probabilities","corresponding","to","each","callable","in","transforms",".","Probabilities","are","normalized","to","sum","to","one",".","map_items",":","whether","to","apply","transform","to","each","item","in","the","input","`","data","`","if","`","data","`","is","a","list","or","tuple",".","defaults","to","`","True","`",".","unpack_items",":","whether","to","unpack","input","`","data","`","with","`","*","`","as","parameters","for","the","callable","function","of","transform",".","defaults","to","`","False","`",".","log_stats",":","this","optional","parameter","allows","you","to","specify","a","logger","by","name","for","logging","of","pipeline","execution",".","Setting","this","to","False","disables","logging",".","Setting","it","to","True","enables","logging","to","the","default","loggers",".","Setting","a","string","overrides","the","logger","name","to","which","logging","is","performed",".","lazy",":","whether","to","enable",":","ref",":","`","Lazy","Resampling","<","lazy_resampling",">","`","for","lazy","transforms",".","If","False",",","transforms","will","be","carried","out","on","a","transform","by","transform","basis",".","If","True",",","all","lazy","transforms","will","be","executed","by","accumulating","changes","and","resampling","as","few","times","as","possible",".","If","lazy","is","None",",","`","Compose","`","will","perform","lazy","execution","on","lazy","transforms","that","have","their","`","lazy","`","property","set","to","True",".","overrides",":","this","optional","parameter","allows","you","to","specify","a","dictionary","of","parameters","that","should","be","overridden","when","executing","a","pipeline",".","These","each","parameter","that","is","compatible","with","a","given","transform","is","then","applied","to","that","transform","before","it","is","executed",".","Note","that","overrides","are","currently","only","applied","when",":","ref",":","`","Lazy","Resampling","<","lazy_resampling",">","`","is","enabled","for","the","pipeline","or","a","given","transform",".","If","lazy","is","False","they","are","ignored",".","Currently","supported","args","are",":","{","``","``","mode","''","``",",","``","``","padding_mode","''","``",",","``","``","dtype","''","``",",","``","``","align_corners","''","``",",","``","``","resample_mode","''","``",",","``","device","``","}","."]
code: def __init__(
      self,
      transforms: Sequence[Callable] | Callable | None = None,
      weights: Sequence[float] | float | None = None,
      map_items: bool = True,
      unpack_items: bool = False,
      log_stats: bool | str = False,
      lazy: bool | None = False,
      overrides: dict | None = None,
  ) -> None:
      super().__init__(
          transforms,
          map_items,
          unpack_items,
          log_stats,
          lazy,
          overrides,
      )
      if len(self.transforms) == 0:
          weights = []
      elif weights is None or isinstance(weights, float):
          weights = [1.0 / len(self.transforms)] * len(self.transforms)
      if len(weights) != len(self.transforms):
          raise ValueError(
              "transforms and weights should be same size if both specified as sequences, "
              f"got {len(weights)} and {len(self.transforms)}."
          )
      self.weights = ensure_tuple(
          self._normalize_probabilities(weights)
      )
      self.log_stats = log_stats
  
imports: from __future__ import annotations
  import warnings
  from collections.abc import Callable, Mapping, Sequence
  from copy import deepcopy
  from typing import Any
  import numpy
  import monai
  from monai.apps.utils import get_logger
  from monai.config import NdarrayOrTensor
  from monai.transforms.inverse import InvertibleTransform
  from monai.transforms.lazy.functional import apply_pending_transforms
  from monai.transforms.traits import ThreadUnsafe
  from monai.transforms.transform import LazyTransform, MapTransform, Randomizable, RandomizableTransform, Transform, apply_transform
  from monai.utils import MAX_SEED, TraceKeys, TraceStatusKeys, ensure_tuple, get_seed
label_desc: Use image node_id 1 to create a new OneOf object from inherited base classes: Compose with example: obj = OneOf(transforms, weights, map_items, unpack_items, log_stats, lazy, overrides)