code: def test_polygon_perimeter():
      expected = np.array([[1, 1, 1, 1], [1, 0, 0, 1], [1, 1, 1, 1]])
      out = np.zeros_like(expected)
  
      rr, cc = polygon_perimeter([0, 2, 2, 0], [0, 0, 3, 3])
  
      out[rr, cc] = 1
      assert_array_equal(out, expected)
  
      out = np.zeros_like(expected)
      rr, cc = polygon_perimeter(
          [-1, -1, 3, 3], [-1, 4, 4, -1], shape=out.shape, clip=True
      )
      out[rr, cc] = 1
      assert_array_equal(out, expected)
  
      with pytest.raises(ValueError):
          polygon_perimeter([0], [1], clip=True)
  
imports: import numpy
  from numpy.testing import assert_array_equal, assert_equal, assert_almost_equal
  import pytest
  from skimage._shared.testing import run_in_parallel
  from skimage._shared._dependency_checks import has_mpl
  from skimage.draw import set_color, line, line_aa, polygon, polygon_perimeter, disk, circle_perimeter, circle_perimeter_aa, ellipse, ellipse_perimeter, _bezier_segment, bezier_curve, rectangle, rectangle_perimeter
  from skimage.measure import regionprops
label_desc: Use image node_id 40 for calling a global function with example usage: test_polygon_perimeter() without return types