code: def polygon_generator():
      """Generator for complex polygons. Each polygon will
      have 1-4 randomly rotated interior rings. Each polygon
      is a circle, with very small inner rings located in
      a spiral around its center.
      Usage: poly=generator(n, distance_from_origin, radius)
      """
      rstate = np.random.RandomState(0)
  
      def generator(n, distance_from_origin, radius=1.0):
          for _ in range(n):
              outer = Point(distance_from_origin * 2, 0).buffer(radius)
              inners = []
              for i in range(rstate.randint(1, 4)):
                  inner = Point(
                      distance_from_origin + i * 0.1, 0
                  ).buffer(0.01 * radius)
                  inners.append(inner)
              together = Polygon(outer, inners)
              yield rotate(
                  together,
                  rstate.random() * 2 * np.pi,
                  use_radians=True,
              )
  
      return generator
  
imports: import geopandas
  import numpy
  import pandas
  import pytest
  from shapely.affinity import rotate
  from shapely.geometry import LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon
label_desc: Use image node_id 10 for calling a global function with example usage: polygon_generator() and returns: generator