code: def traffic_light(
      value,
      red_high,
      yellow_high,
      yellow_low: int = 0,
      red_low: int = 0,
  ) -> int:
      """Get the corresponding traffic light given a value and traffic light bounds.
  
      :param float value: value to check
      :param float red_high: higher bound of red traffic light
      :param float yellow_high: higher bound of yellow traffic light
      :param float yellow_low: lower bound of yellow traffic light (optional)
      :param float red_low: lower bound of red traffic light (optional)
  
      :return: corresponding traffic light based on the value and traffic light bounds
      """
      if (
          np.diff([red_high, yellow_high, yellow_low, red_low]) > 0
      ).sum() != 0:
          raise ValueError("Traffic lights not sorted!")
  
      if value < red_low or value >= red_high:
          return 2
      elif value < yellow_low or value >= yellow_high:
          return 1
      return 0
  
imports: from __future__ import annotations
  import copy
  import fnmatch
  from collections import defaultdict
  from typing import Any
  import numpy
  import pandas
  from popmon.analysis.apply_func import ApplyFunc
  from popmon.base import Module, Pipeline
label_desc: Use image node_id 2 for calling a global function with example usage: traffic_light(value, red_high, yellow_high, yellow_low, red_low) and returns: int, int, int