code: def test_offset_polygon(self):
      # usual case
      polygons = np.array([0, 0, 0, 1, 1, 1, 1, 0], dtype=np.float32)
      expanded_polygon = offset_polygon(polygons, 1)
      self.assertTrue(
          poly2shapely(expanded_polygon).equals(
              poly2shapely(
                  np.array(
                      [
                          2,
                          0,
                          2,
                          1,
                          1,
                          2,
                          0,
                          2,
                          -1,
                          1,
                          -1,
                          0,
                          0,
                          -1,
                          1,
                          -1,
                      ]
                  )
              )
          )
      )
  
      # Overshrunk polygon doesn't exist
      shrunk_polygon = offset_polygon(polygons, -10)
      self.assertEqual(len(shrunk_polygon), 0)
  
      # When polygon is shrunk into two polygons, it is regarded as invalid
      # and an empty array is returned.
      polygons = np.array(
          [0, 0, 0, 3, 1, 2, 2, 3, 2, 0, 1, 1], dtype=np.float32
      )
      shrunk = offset_polygon(polygons, -1)
      self.assertEqual(len(shrunk), 0)
  
imports: import unittest
  from itertools import chain, permutations
  import numpy
  import torch
  from shapely.geometry import MultiPolygon, Polygon
  from mmocr.utils import boundary_iou, crop_polygon, offset_polygon, poly2bbox, poly2shapely, poly_intersection, poly_iou, poly_make_valid, poly_union, polys2shapely, rescale_polygon, rescale_polygons, shapely2poly, sort_points, sort_vertex, sort_vertex8
label_desc: Use image node_id 12 for calling the TestPolygonUtils obj's underlying member method code with example usage: obj.test_offset_polygon() without return types