code: def get_rings(geometry, return_index=False):
      """Gets rings of Polygon geometry object.
  
      For each Polygon, the first returned ring is always the exterior ring
      and potential subsequent rings are interior rings.
  
      If the geometry is not a Polygon, nothing is returned (empty array for
      scalar geometry input or no element in output array for array input).
  
      Parameters
      ----------
      geometry : Geometry or array_like
      return_index : bool, default False
          If True, will return a tuple of ndarrays of (rings, indexes), where
          indexes are the indexes of the original geometries in the source array.
  
      Returns
      -------
      ndarray of rings or tuple of (rings, indexes)
  
      See also
      --------
      get_exterior_ring, get_interior_ring, get_parts
  
      Examples
      --------
      >>> from shapely import Polygon
      >>> polygon_with_hole = Polygon(
      ...     [(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)],
      ...     holes=[[(2, 2), (2, 4), (4, 4), (4, 2), (2, 2)]]
      ... )
      >>> get_rings(polygon_with_hole).tolist()
      [<LINEARRING (0 0, 0 10, 10 10, 10 0, 0 0)>,
       <LINEARRING (2 2, 2 4, 4 4, 4 2, 2 2)>]
  
      With ``return_index=True``:
  
      >>> polygon = Polygon([(0, 0), (2, 0), (2, 2), (0, 2), (0, 0)])
      >>> rings, index = get_rings([polygon, polygon_with_hole], return_index=True)
      >>> rings.tolist()
      [<LINEARRING (0 0, 2 0, 2 2, 0 2, 0 0)>,
       <LINEARRING (0 0, 0 10, 10 10, 10 0, 0 0)>,
       <LINEARRING (2 2, 2 4, 4 4, 4 2, 2 2)>]
      >>> index.tolist()
      [0, 1, 1]
      """
      geometry = np.asarray(geometry, dtype=np.object_)
      geometry = np.atleast_1d(geometry)
  
      if geometry.ndim != 1:
          raise ValueError("Array should be one dimensional")
  
      if return_index:
          return _geometry_helpers.get_parts(
              geometry, extract_rings=True
          )
  
      return _geometry_helpers.get_parts(geometry, extract_rings=True)[
          0
      ]
  
imports: import warnings
  from enum import IntEnum
  import numpy
  from shapely import _geometry_helpers, geos_version, lib
  from shapely._enum import ParamEnum
  from shapely.decorators import multithreading_enabled
label_desc: Use image node_id 17 for calling a global function with example usage: get_rings(geometry, return_index) and returns: _geometry_helpers, _geometry_helpers