code: def _linestrings_from_points(geoseries):
      """Converts a geoseries of points into a geoseries of linestrings.
  
      Linestrings converted to points are represented as a segment of
      length two, with the beginning and ending of the segment being the
      same point.
  
      Example
      -------
      >>> import cuspatial
      >>> from cuspatial.utils.binpred_utils import (
      ...     _linestrings_from_points
      ... )
      >>> from shapely.geometry import Point
      >>> points = cuspatial.GeoSeries([Point(0, 0), Point(1, 1)])
      >>> linestrings = _linestrings_from_points(points)
      >>> linestrings
      Out[1]:
      0    LINESTRING (0.00000 0.00000, 0.00000 0.00000)
      1    LINESTRING (1.00000 1.00000, 1.00000 1.00000)
      dtype: geometry
      """
      x = cp.repeat(geoseries.points.x, 2)
      y = cp.repeat(geoseries.points.y, 2)
      xy = cudf.DataFrame({"x": x, "y": y}).interleave_columns()
      parts = cp.arange((len(geoseries) + 1)) * 2
      geometries = cp.arange(len(geoseries) + 1)
      return cuspatial.GeoSeries.from_linestrings_xy(
          xy, parts, geometries
      )
  
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 8 for calling a global function with example usage: _linestrings_from_points(geoseries) and returns: cuspatial