code: def sim_shadow(
      tens: Tensor,
      num_shadows: int = 1,
      rectangular_roi: Tuple = (-1, -1, -1, -1),
      shadow_dimension: int = 5,
  ) -> Tensor:
      r"""
          Simulate shadowy conditions on an image.
  
      Args:
          tens (Tensor) : Any regular ``caer.Tensor``.
          num_shadows (int): Number of shadows to work with. Value must be between 1 and 10.
          rectangular_roi (tuple): Rectanglar co-ordinates of the intended region of interest. Default: (-1,-1,-1,-1).
          shadow_dimensions (int): Number of shadow dimensions. Value must be > 3.
  
      Returns:
          Tensor of shape ``(height, width, channels)``.
  
      Examples::
  
          >> tens = caer.data.sunrise
          >> filtered = caer.filters.sim_shadow(tens)
          >> filtered
          (427, 640, 3)
  
      """
      if not (
          is_numeric(num_shadows)
          and num_shadows >= 1
          and num_shadows <= 10
      ):
          raise ValueError(
              "Only 1-10 shadows can be introduced in an image"
          )
  
      if not (
          is_numeric(shadow_dimension)
          and shadow_dimension >= 3
          and shadow_dimension <= 10
      ):
          raise ValueError(
              "Polygons with dimensions < 3 don't exist and take time to plot"
          )
  
      if (
          is_tuple(rectangular_roi)
          and is_numeric_list_or_tuple(rectangular_roi)
          and len(rectangular_roi) == 4
      ):
          x1 = rectangular_roi[0]
          y1 = rectangular_roi[1]
          x2 = rectangular_roi[2]
          y2 = rectangular_roi[3]
      else:
          raise ValueError("Rectangular ROI dimensions are not valid")
  
      if rectangular_roi == (-1, -1, -1, -1):
          x1 = 0
  
          if is_tensor(tens):
              y1 = tens.shape[0] // 2
              x2 = tens.shape[1]
              y2 = tens.shape[0]
          else:
              y1 = tens[0].shape[0] // 2
              x2 = tens[0].shape[1]
              y2 = tens[0].shape[0]
  
      elif (
          x1 == -1
          or y1 == -1
          or x2 == -1
          or y2 == -1
          or x2 <= x1
          or y2 <= y1
      ):
          raise ValueError("Rectangular ROI dimensions are not valid")
  
      return _shadow_process(
          tens, num_shadows, x1, y1, x2, y2, shadow_dimension
      )
  
file_path: caer/caer/transforms/simulate.py
imports: import numpy
  import cv2
  import random
  import math
  from ..coreten import Tensor, is_tensor
  from ..annotations import Tuple, Optional, Union
  from .functional import is_numeric, is_numeric_list_or_tuple, is_tuple, _rgb, _snow_process, _generate_random_lines, _rain_process, _generate_random_blur_coordinates, _add_blur, _gravel_process, _add_sun_flare_line, _add_sun_process, _apply_motion_blur, _autumn_process, _shadow_process
label_desc: Use image node_id 8 for calling a global function with example usage: sim_shadow(tens, num_shadows, rectangular_roi, shadow_dimension) and returns: _shadow_process