code: def test_viz():
      image = cv2.imread("tests/fixtures/ocr/test_gcv_image.jpg")
      ocr_agent = GCVAgent.with_credential(
          "tests/fixtures/ocr/test_gcv_credential.json",
          languages=["en"],
      )
      res = ocr_agent.load_response(
          "tests/fixtures/ocr/test_gcv_response.json"
      )
  
      draw_box(image, Layout([]))
      draw_text(image, Layout([]))
  
      layout = Layout(
          [
              Interval(0, 10, axis="x"),
              Rectangle(0, 50, 100, 80),
              Quadrilateral(
                  np.array([[10, 10], [30, 40], [90, 40], [10, 20]])
              ),
          ]
      )
  
      draw_box(image, layout)
      draw_text(image, layout)
  
      # Test colors
      draw_box(image, layout, box_color=["red", "green", "blue"])
      draw_box(image, layout, box_color="red")
  
      draw_text(image, layout, box_color=["red", "green", "blue"])
      with pytest.raises(ValueError):
          draw_box(
              image,
              layout,
              box_color=["red", "green", "blue", "yellow"],
          )
      with pytest.raises(ValueError):
          draw_text(
              image,
              layout,
              box_color=["red", "green", "blue", "yellow"],
              with_layout=True,
          )
  
      # Test alphas
      draw_box(image, layout, box_alpha=0)
      draw_box(image, layout, box_alpha=[0.1, 0.2, 0.3])
      with pytest.raises(ValueError):
          draw_box(image, layout, box_color=[0.1, 0.2, 0.3, 0.5])
      with pytest.raises(ValueError):
          draw_box(image, layout, box_color=[0.1, 0.2, 0.3, 1.5])
  
      # Test widths
      draw_box(image, layout, box_width=1)
      draw_box(image, layout, box_width=[1, 2, 3])
      with pytest.raises(ValueError):
          draw_box(image, layout, box_width=[1, 2, 3, 4])
  
      draw_box(
          image,
          layout,
          box_alpha=[0.1, 0.2, 0.3],
          box_width=[1, 2, 3],
          box_color=["red", "green", "blue"],
      )
  
      for idx, level in enumerate(
          [
              GCVFeatureType.SYMBOL,
              GCVFeatureType.WORD,
              GCVFeatureType.PARA,
              GCVFeatureType.BLOCK,
              GCVFeatureType.PAGE,
          ]
      ):
          layout = ocr_agent.gather_full_text_annotation(res, level)
  
          draw_text(
              image,
              layout,
              arrangement="ud" if idx % 2 else "ud",
              font_size=15,
              text_color="pink",
              text_background_color="grey",
              text_background_alpha=0.1,
              with_box_on_text=True,
              text_box_width=2,
              text_box_color="yellow",
              text_box_alpha=0.2,
              with_layout=True,
              box_width=1,
              color_map={None: "blue"},
              show_element_id=True,
              id_font_size=8,
              box_alpha=0.25,
              id_text_background_alpha=0.25,
          )
  
          draw_box(image, layout)
          draw_text(image, layout)
  
imports: import pytest
  from layoutparser.elements import *
  from layoutparser.ocr import *
  from layoutparser.visualization import *
  import cv2
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_viz() without return types