code: def test_get_screenshot_as_png_with_glyph(
      webdriver: WebDriver, dimensions: tuple[int, int]
  ) -> None:
      if sys.platform == "darwin" and webdriver.name == "firefox":
          pytest.skip(reason="unreliable on MacOS and Firefox")
  
      width, height = dimensions
      border = 5
  
      layout = Plot(
          x_range=Range1d(-1, 1),
          y_range=Range1d(-1, 1),
          height=width,
          width=height,
          toolbar_location=None,
          min_border=border,
          hidpi=False,
          outline_line_color=None,
          background_fill_color="#00ff00",
          border_fill_color="#00ff00",
      )
      glyph = Rect(
          x="x",
          y="y",
          width=2,
          height=2,
          fill_color="#ff0000",
          line_color="#ff0000",
      )
      source = ColumnDataSource(data=dict(x=[0], y=[0]))
      layout.add_glyph(source, glyph)
  
      png = bie.get_screenshot_as_png(layout, driver=webdriver)
      assert png.size == (width, height)
  
      data = png.tobytes()
      assert len(data) == 4 * width * height
  
      # count red pixels in center area
      count = 0
      for x in range(width * height):
          pixel = data[x * 4 : x * 4 + 4]
          if pixel == b"\xff\x00\x00\xff":
              count += 1
  
      w, h, b = width, height, border
      expected_count = w * h - 2 * b * (w + h) + 4 * b**2
      assert count == expected_count
  
imports: from __future__ import annotations
  import pytest
  import base64
  import re
  import sys
  from typing import TYPE_CHECKING
  from bokeh.core.validation import silenced
  from bokeh.core.validation.warnings import MISSING_RENDERERS
  from bokeh.io.state import curstate
  from bokeh.io.webdriver import webdriver_control
  from bokeh.layouts import row
  from bokeh.models import Circle, ColumnDataSource, Div, Plot, Range1d, Rect
  from bokeh.plotting import figure
  from bokeh.resources import Resources
  from bokeh.themes import Theme
  import bokeh.io.export
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_screenshot_as_png_with_glyph(webdriver, dimensions) without return types