code: def sim_gravel(
      tens: Tensor,
      rectangular_roi: Tuple = (-1, -1, -1, -1),
      num_patches: int = 8,
  ) -> Tensor:
      r"""
          Simulate gravelly conditions on an image.
  
      Args:
          tens (Tensor) : Any regular ``caer.Tensor``.
          rectangular_roi (tuple): Rectanglar co-ordinates of the intended region of interest. Default: (-1,-1,-1,-1).
          num_patches (int): Number of patches to operate on.
  
      Returns:
          Tensor of shape ``(height, width, channels)``.
  
      Examples::
  
          >> tens = caer.data.sunrise
          >> filtered = caer.filters.sim_gravel(tens)
          >> filtered
          (427, 640, 3)
  
      """
      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 invalid.")
  
      if rectangular_roi == (-1, -1, -1, -1):
          if is_tensor(tens):
              x1 = 0
              y1 = int(tens.shape[0] * 3 / 4)
              x2 = tens.shape[1]
              y2 = tens.shape[0]
          else:
              x1 = 0
              y1 = int(tens[0].shape[0] * 3 / 4)
              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 invalid.")
  
      return _gravel_process(tens, x1, x2, y1, y2, num_patches)
  
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 4 for calling a global function with example usage: sim_gravel(tens, rectangular_roi, num_patches) and returns: _gravel_process