code: def multilinestring_generator(linestring_generator):
      """Generator for n multilinestrings.
      Usage: mls=generator(n, max_num_lines, max_num_segments)
      """
      rstate = np.random.RandomState(0)
  
      def generator(n, max_num_geometries, max_num_segments):
          for _ in range(n):
              num_geometries = rstate.randint(1, max_num_geometries)
              yield MultiLineString(
                  [
                      *linestring_generator(
                          num_geometries, max_num_segments
                      )
                  ]
              )
  
      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 8 for calling a global function with example usage: multilinestring_generator(linestring_generator) and returns: generator