code: def sort_vertex8(points):
      # TODO Add typehints & docstring & test
      """Sort vertex with 8 points [x1 y1 x2 y2 x3 y3 x4 y4]"""
      assert len(points) == 8
      vertices = _sort_vertex(
          np.array(points, dtype=np.float32).reshape(-1, 2)
      )
      sorted_box = list(vertices.flatten())
      return sorted_box
  
imports: import math
  import operator
  from functools import reduce
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import pyclipper
  import shapely
  from mmengine.utils import is_list_of
  from shapely.geometry import MultiPolygon, Polygon
  from mmocr.utils import bbox2poly, valid_boundary
  from mmocr.utils.check_argument import is_2dlist
  from mmocr.utils.typing_utils import ArrayLike
label_desc: Use image node_id 18 for calling a global function with example usage: sort_vertex8(points) and returns: sorted_box