code: def test_pigear_parameters(
      camera_num,
      resolution,
      framerate,
      time_delay,
      options,
      colorspace,
      exception_type,
  ):
      """
      Tests PiGear's options and colorspace.
      """
      stream = None
      try:
          from vidgear.gears import PiGear
  
          # open pi video stream with default parameters
          stream = PiGear(
              camera_num=camera_num,
              resolution=resolution,
              framerate=framerate,
              logging=True,
              time_delay=time_delay,
              **options,
          ).start()
          # playback
          i = 0
          while i < 20:
              frame = stream.read()
              if frame is None:
                  break
              time.sleep(0.1)
              if i == 10:
                  if colorspace == "COLOR_BGR2INVALID":
                      # test wrong colorspace value
                      stream.color_space = 1546755
                  else:
                      # test invalid colorspace value
                      stream.color_space = "red"
              i += 1
      except Exception as e:
          if not (exception_type is None) and isinstance(
              e, exception_type
          ):
              pytest.xfail(str(e))
          else:
              pytest.fail(str(e))
      finally:
          # clean resources
          if not (stream is None):
              stream.stop()
  
imports: import time
  import pytest
  import logging
  import platform
  from vidgear.gears.helper import logger_handler
label_desc: Use image node_id 2 for calling a global function with example usage: test_pigear_parameters(camera_num, resolution, framerate, time_delay, options, colorspace, exception_type) without return types