code: def linestring_generator_device(polygon_generator_device):
      """Reusing polygon_generator_device, treating the rings of the
      generated polygons as linestrings. This is to gain locality to
      the generated linestrings.
      """
  
      def generator(n, segment_per_linestring):
          polygons = polygon_generator_device(
              n, segment_per_linestring, all_concentric=False
          )
  
          return cuspatial.GeoSeries.from_linestrings_xy(
              polygons.polygons.xy,
              polygons.polygons.ring_offset,
              polygons.polygons.geometry_offset,
          )
  
      return generator
  
imports: import cupy
  import geopandas
  import numpy
  import pandas
  import pytest
  import pytest_cases
  from numba import cuda
  from shapely.geometry import LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon
  import cudf
  import cuspatial
label_desc: Use image node_id 17 for calling a global function with example usage: linestring_generator_device(polygon_generator_device) and returns: generator, cuspatial