code: def get_coordinates(geometry, include_z=False, return_index=False):
      """Gets coordinates from a geometry array as an array of floats.
  
      The shape of the returned array is (N, 2), with N being the number of
      coordinate pairs. With the default of ``include_z=False``, three-dimensional
      data is ignored. When specifying ``include_z=True``, the shape of the
      returned array is (N, 3).
  
      Parameters
      ----------
      geometry : Geometry or array_like
      include_z : bool, default False
          If, True include the third dimension in the output. If a geometry
          has no third dimension, the z-coordinates will be NaN.
      return_index : bool, default False
          If True, also return the index of each returned geometry as a separate
          ndarray of integers. For multidimensional arrays, this indexes into the
          flattened array (in C contiguous order).
  
      Examples
      --------
      >>> from shapely import LineString, Point
      >>> get_coordinates(Point(0, 0)).tolist()
      [[0.0, 0.0]]
      >>> get_coordinates(LineString([(2, 2), (4, 4)])).tolist()
      [[2.0, 2.0], [4.0, 4.0]]
      >>> get_coordinates(None)
      array([], shape=(0, 2), dtype=float64)
  
      By default the third dimension is ignored:
  
      >>> get_coordinates(Point(0, 0, 0)).tolist()
      [[0.0, 0.0]]
      >>> get_coordinates(Point(0, 0, 0), include_z=True).tolist()
      [[0.0, 0.0, 0.0]]
  
      When return_index=True, indexes are returned also:
  
      >>> geometries = [LineString([(2, 2), (4, 4)]), Point(0, 0)]
      >>> coordinates, index = get_coordinates(geometries, return_index=True)
      >>> coordinates.tolist(), index.tolist()
      ([[2.0, 2.0], [4.0, 4.0], [0.0, 0.0]], [0, 0, 1])
      """
      return lib.get_coordinates(
          np.asarray(geometry, dtype=np.object_),
          include_z,
          return_index,
      )
  
file_path: shapely/shapely/coordinates.py
imports: from typing import Optional
  import numpy
  import shapely
  from shapely import lib
label_desc: Use image node_id 3 for calling a global function with example usage: get_coordinates(geometry, include_z, return_index) and returns: lib