code: def test_draw_line():
      x0, y0 = (0, 0)
      x1, y1 = (3, 3)
      out = np.array(
          [
              [1, 0, 0, 0, 0],
              [0, 1, 0, 0, 0],
              [0, 0, 1, 0, 0],
              [0, 0, 0, 1, 0],
              [0, 0, 0, 0, 0],
          ]
      )
      agg = new_agg()
      draw_segment(x0, y0, x1, y1, 0, True, agg)
      np.testing.assert_equal(agg, out)
      agg = new_agg()
      draw_segment(x1, y1, x0, y0, 0, True, agg)
      np.testing.assert_equal(agg, out)
      # plot_start = False
      agg = new_agg()
      draw_segment(x0, y0, x1, y1, 0, False, agg)
      out[0, 0] = 0
      np.testing.assert_equal(agg, out)
      agg = new_agg()
      draw_segment(x1, y1, x0, y0, 0, False, agg)
      out[0, 0] = 1
      out[3, 3] = 0
      np.testing.assert_equal(agg, out)
      # Flip coords
      x0, y0 = (0, 4)
      x1, y1 = (3, 1)
      out = np.array(
          [
              [0, 0, 0, 0, 0],
              [0, 0, 0, 1, 0],
              [0, 0, 1, 0, 0],
              [0, 1, 0, 0, 0],
              [1, 0, 0, 0, 0],
          ]
      )
      agg = new_agg()
      draw_segment(x0, y0, x1, y1, 0, True, agg)
      np.testing.assert_equal(agg, out)
      agg = new_agg()
      draw_segment(x1, y1, x0, y0, 0, True, agg)
      np.testing.assert_equal(agg, out)
      # plot_start = False
      agg = new_agg()
      draw_segment(x0, y0, x1, y1, 0, False, agg)
      out[4, 0] = 0
      np.testing.assert_equal(agg, out)
      agg = new_agg()
      draw_segment(x1, y1, x0, y0, 0, False, agg)
      out[4, 0] = 1
      out[1, 3] = 0
  
imports: from __future__ import annotations
  import pandas
  import numpy
  import pytest
  from datashader.datashape import dshape
  from datashader.glyphs import Point, LinesAxis1, Glyph
  from datashader.glyphs.area import _build_draw_trapezoid_y
  from datashader.glyphs.line import _build_map_onto_pixel_for_line, _build_draw_segment, _build_extend_line_axis0
  from datashader.glyphs.trimesh import _build_map_onto_pixel_for_triangle, _build_draw_triangle, _build_extend_triangles
  from datashader.utils import ngjit
label_desc: Use image node_id 8 for calling a global function with example usage: test_draw_line() without return types