code: def weighted_merge(g, p):
      """
      Weighted merge.
      """
      g[:8] = (g[8] * g[:8] + p[8] * p[:8]) / (g[8] + p[8])
      g[8] = g[8] + p[8]
      return g
  
file_path: PaddleOCR/ppocr/postprocess/locality_aware_nms.py
imports: import numpy
  from shapely.geometry import Polygon
label_desc: Use image node_id 3 for calling a global function with example usage: weighted_merge(g, p) and returns: g