code: def _PolygonPatch(polygon, **kwargs):
      """Constructs a matplotlib patch from a Polygon geometry
  
      The `kwargs` are those supported by the matplotlib.patches.PathPatch class
      constructor. Returns an instance of matplotlib.patches.PathPatch.
  
      Example (using Shapely Point and a matplotlib axes)::
  
          b = shapely.geometry.Point(0, 0).buffer(1.0)
          patch = _PolygonPatch(b, fc='blue', ec='blue', alpha=0.5)
          ax.add_patch(patch)
  
      GeoPandas originally relied on the descartes package by Sean Gillies
      (BSD license, https://pypi.org/project/descartes) for PolygonPatch, but
      this dependency was removed in favor of the below matplotlib code.
      """
      from matplotlib.patches import PathPatch
      from matplotlib.path import Path
  
      path = Path.make_compound_path(
          Path(np.asarray(polygon.exterior.coords)[:, :2]),
          *[
              Path(np.asarray(ring.coords)[:, :2])
              for ring in polygon.interiors
          ],
      )
      return PathPatch(path, **kwargs)
  
imports: import warnings
  import numpy
  import pandas
  from pandas.plotting import PlotAccessor
  from pandas import CategoricalDtype
  import geopandas
  from packaging.version import Version
  from ._decorator import doc
label_desc: Use image node_id 4 for calling a global function with example usage: _PolygonPatch(polygon) and returns: PathPatch