code: def sim_fog(tens: Tensor, fog_coeff: int = -1) -> Tensor:
      r"""
          Simulate foggy conditions on an image.
  
      Args:
          tens (Tensor) : Any regular ``caer.Tensor``.
          fog_coeff (int): Coefficient value.
  
      Returns:
          Tensor of shape ``(height, width, channels)``.
  
      Examples::
  
          >> tens = caer.data.sunrise
          >> filtered = caer.filters.sim_fog(tens, fog_coeff=-1)
          >> filtered
          (427, 640, 3)
  
      """
      if fog_coeff != -1:
          if fog_coeff < 0.0 or fog_coeff > 1.0:
              raise ValueError(
                  "Fog coefficient must be between 0 and 1"
              )
  
      imshape = tens.shape
  
      if fog_coeff == -1:
          fog_coeff_t = random.uniform(0.3, 1)
      else:
          fog_coeff_t = fog_coeff
  
      hw = int(imshape[1] // 3 * fog_coeff_t)
      haze_list = _generate_random_blur_coordinates(imshape, hw)
      for haze_points in haze_list:
          tens = _add_blur(
              tens, haze_points[0], haze_points[1], hw, fog_coeff_t
          )
  
      tens = cv.blur(tens, (hw // 10, hw // 10))
  
      return _rgb(tens)
  
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 3 for calling a global function with example usage: sim_fog(tens, fog_coeff) and returns: _rgb