code: def test_box_on_line(self):
      # regular boxes
      box1 = [0, 0, 1, 0, 1, 1, 0, 1]
      box2 = [2, 0.5, 3, 0.5, 3, 1.5, 2, 1.5]
      box3 = [4, 0.8, 5, 0.8, 5, 1.8, 4, 1.8]
      self.assertTrue(is_on_same_line(box1, box2, 0.5))
      self.assertFalse(is_on_same_line(box1, box3, 0.5))
  
      # irregular box4
      box4 = [0, 0, 1, 1, 1, 2, 0, 1]
      box5 = [2, 1.5, 3, 1.5, 3, 2.5, 2, 2.5]
      box6 = [2, 1.6, 3, 1.6, 3, 2.6, 2, 2.6]
      self.assertTrue(is_on_same_line(box4, box5, 0.5))
      self.assertFalse(is_on_same_line(box4, box6, 0.5))
  
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 1 for calling the TestIsOnSameLine obj's underlying member method code with example usage: obj.test_box_on_line() without return types