code: def random_shadow(
      img: tf.Tensor, opacity_range: Tuple[float, float], **kwargs
  ) -> tf.Tensor:
      """Apply a random shadow to a given image
  
      Args:
      ----
          img: image to modify
          opacity_range: the minimum and maximum desired opacity of the shadow
          **kwargs: additional arguments to pass to `create_shadow_mask`
  
      Returns:
      -------
          shadowed image
      """
      shadow_mask = create_shadow_mask(img.shape[:2], **kwargs)
  
      opacity = np.random.uniform(*opacity_range)
      shadow_tensor = 1 - tf.convert_to_tensor(
          shadow_mask[..., None], dtype=tf.float32
      )
  
      # Add some blur to make it believable
      k = 7 + int(2 * 4 * random.random())
      sigma = random.uniform(0.5, 5.0)
      shadow_tensor = _gaussian_filter(
          shadow_tensor[tf.newaxis, ...],
          kernel_size=k,
          sigma=sigma,
          mode="REFLECT",
      )
  
      return tf.squeeze(
          opacity * shadow_tensor * img + (1 - opacity) * img, axis=0
      )
  
file_path: doctr/doctr/transforms/functional/tensorflow.py
imports: import math
  import random
  from copy import deepcopy
  from typing import Iterable, Optional, Tuple, Union
  import numpy
  import tensorflow
  from doctr.utils.geometry import compute_expanded_shape, rotate_abs_geoms
  from .base import create_shadow_mask, crop_boxes
label_desc: Use image node_id 6 for calling a global function with example usage: random_shadow(img, opacity_range) and returns: tf