code: def polygons(
      geometries, holes=None, indices=None, out=None, **kwargs
  ):
      """Create an array of polygons.
  
      Parameters
      ----------
      geometries : array_like
          An array of linearrings or coordinates (see linearrings).
          Unless ``indices`` are given (see description below), this
          include the outer shells only. The ``holes`` argument should be used
          to create polygons with holes.
      holes : array_like, optional
          An array of lists of linearrings that constitute holes for each shell.
          Not to be used in combination with ``indices``.
      indices : array_like, optional
          Indices into the target array where input geometries belong. If
          provided, the holes are expected to be present inside ``geometries``;
          the first geometry for each index is the outer shell
          and all subsequent geometries in that index are the holes.
          Both geometries and indices should be 1D and have matching sizes.
          Indices should be in increasing order. Missing indices result in a ValueError
          unless ``out`` is  provided, in which case the original value in ``out`` is kept.
      out : ndarray, optional
          An array (with dtype object) to output the geometries into.
      **kwargs
          See :ref:`NumPy ufunc docs <ufuncs.kwargs>` for other keyword arguments.
          Ignored if ``indices`` is provided.
  
      Examples
      --------
      Polygons are constructed from rings:
  
      >>> ring_1 = linearrings([[0, 0], [0, 10], [10, 10], [10, 0]])
      >>> ring_2 = linearrings([[2, 6], [2, 7], [3, 7], [3, 6]])
      >>> polygons([ring_1, ring_2])[0]
      <POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))>
      >>> polygons([ring_1, ring_2])[1]
      <POLYGON ((2 6, 2 7, 3 7, 3 6, 2 6))>
  
      Or from coordinates directly:
  
      >>> polygons([[0, 0], [0, 10], [10, 10], [10, 0]])
      <POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))>
  
      Adding holes can be done using the ``holes`` keyword argument:
  
      >>> polygons(ring_1, holes=[ring_2])
      <POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0), (2 6, 2 7, 3 7, 3 6, 2 6))>
  
      Or using the ``indices`` argument:
  
      >>> polygons([ring_1, ring_2], indices=[0, 1])[0]
      <POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))>
      >>> polygons([ring_1, ring_2], indices=[0, 1])[1]
      <POLYGON ((2 6, 2 7, 3 7, 3 6, 2 6))>
      >>> polygons([ring_1, ring_2], indices=[0, 0])[0]
      <POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0), (2 6, 2 7, 3 7, 3 6, 2 6))>
  
      Missing input values (``None``) are skipd and may result in an
      empty polygon:
  
      >>> polygons(None)
      <POLYGON EMPTY>
      >>> polygons(ring_1, holes=[None])
      <POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))>
      >>> polygons([ring_1, None], indices=[0, 0])[0]
      <POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))>
      """
      geometries = np.asarray(geometries)
      if not isinstance(geometries, Geometry) and np.issubdtype(
          geometries.dtype, np.number
      ):
          geometries = linearrings(geometries)
  
      if indices is not None:
          if holes is not None:
              raise TypeError(
                  "Cannot specify separate holes array when using indices."
              )
          return collections_1d(
              geometries, indices, GeometryType.POLYGON, out=out
          )
  
      if holes is None:
          # no holes provided: initialize an empty holes array matching shells
          shape = (
              geometries.shape + (0,)
              if isinstance(geometries, np.ndarray)
              else (0,)
          )
          holes = np.empty(shape, dtype=object)
      else:
          holes = np.asarray(holes)
          # convert holes coordinates into linearrings
          if np.issubdtype(holes.dtype, np.number):
              holes = linearrings(holes)
  
      return lib.polygons(geometries, holes, out=out, **kwargs)
  
imports: import numpy
  from shapely import Geometry, GeometryType, lib
  from shapely._enum import ParamEnum
  from shapely._geometry_helpers import collections_1d, simple_geometries_1d
  from shapely.decorators import multithreading_enabled
  from shapely.io import from_wkt
label_desc: Use image node_id 5 for calling a global function with example usage: polygons(geometries, holes, indices, out) and returns: lib, collections_1d