code: def _polynomial_integrate(polynomials, facets, hp_params):
      dims = (x, y)
      dim_length = len(dims)
      integral_value = S.Zero
      for deg in polynomials:
          poly_contribute = S.Zero
          facet_count = 0
          for hp in hp_params:
              value_over_boundary = integration_reduction(
                  facets,
                  facet_count,
                  hp[0],
                  hp[1],
                  polynomials[deg],
                  dims,
                  deg,
              )
              poly_contribute += value_over_boundary * (
                  hp[1] / norm(hp[0])
              )
              facet_count += 1
          poly_contribute /= dim_length + deg
          integral_value += poly_contribute
  
      return integral_value
  
imports: from functools import cmp_to_key
  from sympy.abc import x, y, z
  from sympy.core import S, diff, Expr, Symbol
  from sympy.core.sympify import _sympify
  from sympy.geometry import Segment2D, Polygon, Point, Point2D
  from sympy.polys.polytools import LC, gcd_list, degree_list, Poly
  from sympy.simplify.simplify import nsimplify
label_desc: Use image node_id 3 for calling a global function with example usage: _polynomial_integrate(polynomials, facets, hp_params) and returns: integral_value