code: def _fill(img, coarse_conts):
      result = np.zeros_like(img)
      sorted(coarse_conts, key=lambda x: x[1])
      for contour, priority in coarse_conts:
          if priority == 2:
              cv2.fillPoly(
                  result, [contour.astype(np.int32)], (0, 0, 0)
              )
          else:
              cv2.fillPoly(
                  result, [contour.astype(np.int32)], (255, 255, 255)
              )
      return result
  
file_path: PaddleSeg/EISeg/eiseg/util/regularization/rs_regularization.py
imports: import math
  import cv2
  import numpy
  from .utils import calc_distance
label_desc: Use image node_id 5 for calling a global function with example usage: _fill(img, coarse_conts) and returns: result