code: def test_bezier2polygon(self):
      self.assertTrue(
          np.allclose(bezier2polygon(self.bezier_points1), self.gt1)
      )
      with self.assertRaises(AssertionError):
          bezier2polygon(self.bezier_points2, num_sample=-1)
      with self.assertRaises(AssertionError):
          bezier2polygon(self.invalid_input, num_sample=-1)
  
imports: import unittest
  import numpy
  import torch
  from mmocr.utils import bbox2poly, bbox_center_distance, bbox_diag_distance, bezier2polygon, is_on_same_line, rescale_bbox, rescale_bboxes, stitch_boxes_into_lines
  from mmocr.utils.bbox_utils import bbox_jitter
label_desc: Use image node_id 2 for calling the TestBezier2Polygon obj's underlying member method code with example usage: obj.test_bezier2polygon() without return types