class_docstr: Apply with a probability p the input transformation
  
  .. tabs::
  
      .. tab:: TensorFlow
  
          .. code:: python
  
              >>> import tensorflow as tf
              >>> from doctr.transforms import RandomApply
              >>> transfo = RandomApply(Gamma(), p=.5)
              >>> out = transfo(tf.random.uniform(shape=[64, 64, 3], minval=0, maxval=1))
  
      .. tab:: PyTorch
  
          .. code:: python
  
              >>> import torch
              >>> from doctr.transforms import RandomApply
              >>> transfo = RandomApply(Gamma(), p=.5)
              >>> out = transfo(torch.rand(1, 64, 64, 3))
  
  Args:
  ----
      transform: transformation to apply
      p: probability to apply
code: def __init__(
      self, transform: Callable[[Any], Any], p: float = 0.5
  ) -> None:
      self.transform = transform
      self.p = p
  
imports: import math
  import random
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  from doctr.utils.repr import NestedObject
  from ..None import functional
label_desc: Use image node_id 1 to create a new RandomApply object from inherited base classes: NestedObject with example: obj = RandomApply(transform, p)