code: def _linestring_to_boundary(geoseries):
      """Convert a geoseries of linestrings to a geoseries of multipoints
      containing only the start and end of the linestrings."""
      x = geoseries.lines.x
      y = geoseries.lines.y
      starts = geoseries.lines.part_offset.take(
          geoseries.lines.geometry_offset
      )
      ends = (starts - 1)[1:]
      starts = starts[:-1]
      points_x = cudf.DataFrame(
          {
              "starts": x[starts].reset_index(drop=True),
              "ends": x[ends].reset_index(drop=True),
          }
      ).interleave_columns()
      points_y = cudf.DataFrame(
          {
              "starts": y[starts].reset_index(drop=True),
              "ends": y[ends].reset_index(drop=True),
          }
      ).interleave_columns()
      xy = cudf.DataFrame(
          {"x": points_x, "y": points_y}
      ).interleave_columns()
      mpoints = cp.arange(len(starts) + 1) * 2
      return cuspatial.GeoSeries.from_multipoints_xy(xy, mpoints)
  
imports: import cupy
  import numpy
  import cudf
  import cuspatial
  from cuspatial.core._column.geocolumn import ColumnType
  from cuspatial.core._column.geometa import Feature_Enum
label_desc: Use image node_id 17 for calling a global function with example usage: _linestring_to_boundary(geoseries) and returns: cuspatial