code: def _sort_vertex(vertices):
      # TODO Add typehints & docstring & test
      assert vertices.ndim == 2
      assert vertices.shape[-1] == 2
      N = vertices.shape[0]
      if N == 0:
          return vertices
  
      center = np.mean(vertices, axis=0)
      directions = vertices - center
      angles = np.arctan2(directions[:, 1], directions[:, 0])
      sort_idx = np.argsort(angles)
      vertices = vertices[sort_idx]
  
      left_top = np.min(vertices, axis=0)
      dists = np.linalg.norm(left_top - vertices, axis=-1, ord=2)
      lefttop_idx = np.argmin(dists)
      indexes = (np.arange(N, dtype=np.int_) + lefttop_idx) % N
      return vertices[indexes]
  
file_path: mmocr/mmocr/utils/bbox_utils.py
imports: from typing import List, Tuple
  import numpy
  from shapely.geometry import LineString, Point
  from mmocr.utils.check_argument import is_type_list
  from mmocr.utils.point_utils import point_distance, points_center
  from mmocr.utils.typing_utils import ArrayLike
label_desc: Use image node_id 8 for calling a global function with example usage: _sort_vertex(vertices) and returns: vertices, vertices