code: def _is_closed_polygon(X):
      """
      Return whether first and last object in a sequence are the same. These are
      presumably coordinates on a polygonal curve, in which case this function
      tests if that curve is closed.
      """
      return np.allclose(X[0], X[-1], rtol=1e-10, atol=1e-13)
  
imports: from contextlib import ExitStack
  import functools
  import math
  from numbers import Integral
  import numpy
  from numpy import ma
  import matplotlib
  from matplotlib import _api, _docstring
  from matplotlib.backend_bases import MouseButton
  from matplotlib.lines import Line2D
  from matplotlib.path import Path
  from matplotlib.text import Text
  import matplotlib.ticker
  import matplotlib.cm
  import matplotlib.colors
  import matplotlib.collections
  import matplotlib.font_manager
  import matplotlib.cbook
  import matplotlib.patches
  import matplotlib.transforms
label_desc: Use image node_id 2 for calling a global function with example usage: _is_closed_polygon(X) and returns: np