code: def test_polygon(self):
      coords = ((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0))
  
      # Construct a polygon, exterior ring only
      polygon = Polygon(coords)
      assert len(polygon.exterior.coords) == 5
  
      # Ring Access
      assert isinstance(polygon.exterior, LinearRing)
      ring = polygon.exterior
      assert len(ring.coords) == 5
      assert ring.coords[0] == ring.coords[4]
      assert ring.coords[0] == (0.0, 0.0)
      assert ring.is_ring is True
      assert len(polygon.interiors) == 0
  
      # Create a new polygon from WKB
      data = polygon.wkb
      polygon = None
      ring = None
      polygon = load_wkb(data)
      ring = polygon.exterior
      assert len(ring.coords) == 5
      assert ring.coords[0] == ring.coords[4]
      assert ring.coords[0] == (0.0, 0.0)
      assert ring.is_ring is True
      polygon = None
  
      # Interior rings (holes)
      polygon = Polygon(
          coords, [((0.25, 0.25), (0.25, 0.5), (0.5, 0.5), (0.5, 0.25))]
      )
      assert len(polygon.exterior.coords) == 5
      assert len(polygon.interiors[0].coords) == 5
      with pytest.raises(IndexError):  # index out of range
          polygon.interiors[1]
  
      # Coordinate getter raises exceptions
      with pytest.raises(NotImplementedError):
          polygon.coords
  
      # Geo interface
      assert polygon.__geo_interface__ == {
          "type": "Polygon",
          "coordinates": (
              (
                  (0.0, 0.0),
                  (0.0, 1.0),
                  (1.0, 1.0),
                  (1.0, 0.0),
                  (0.0, 0.0),
              ),
              (
                  (0.25, 0.25),
                  (0.25, 0.5),
                  (0.5, 0.5),
                  (0.5, 0.25),
                  (0.25, 0.25),
              ),
          ),
      }
  
imports: import numpy
  import pytest
  from shapely import LinearRing, LineString, Point, Polygon
  from shapely.coords import CoordinateSequence
  from shapely.errors import TopologicalError
  from shapely.wkb import loads
label_desc: Use image node_id 2 for calling the TestPolygon obj's underlying member method code with example usage: obj.test_polygon() without return types