code: def derive_trajectories(object_ids, points: GeoSeries, timestamps):
      """
      Derive trajectories from object ids, points, and timestamps.
  
      Parameters
      ----------
      object_ids
          column of object (e.g., vehicle) ids
      points : GeoSeries
          The points of the trajectories
      timestamps
          column of timestamps in any resolution
  
      Returns
      -------
      result : tuple (objects, traj_offsets)
          objects : cudf.DataFrame
              object_ids, xs, ys, and timestamps sorted by
              ``(object_id, timestamp)``, used by ``trajectory_bounding_boxes``
              and ``trajectory_distances_and_speeds``
          traj_offsets : cudf.Series
              offsets of discovered trajectories
  
      Examples
      --------
      Compute sorted objects and discovered trajectories
  
      >>> objects, traj_offsets = cuspatial.derive_trajectories(
              [0, 1, 0, 1],  # object_id
              [0, 0, 1, 1],  # x
              [0, 0, 1, 1],  # y
              [0, 10000, 0, 10000] # timestamp
          )
      >>> print(traj_offsets)
          0  0
          1  2
      >>> print(objects)
          object_id    x    y           timestamp
          0          0  0.0  0.0 1970-01-01 00:00:00
          1          0  1.0  1.0 1970-01-01 00:00:10
          2          1  0.0  0.0 1970-01-01 00:00:00
          3          1  1.0  1.0 1970-01-01 00:00:10
      """
  
      if len(points) > 0 and not contains_only_points(points):
          raise ValueError(
              "`points` must only contain point geometries."
          )
  
      object_ids = as_column(object_ids, dtype=np.int32)
      xs = as_column(points.points.x)
      ys = as_column(points.points.y)
      timestamps = normalize_timestamp_column(as_column(timestamps))
      objects, traj_offsets = cpp_derive_trajectories(
          object_ids, xs, ys, timestamps
      )
      return DataFrame._from_data(*objects), Series(data=traj_offsets)
  
file_path: cuspatial/python/cuspatial/cuspatial/core/trajectory.py
imports: import numpy
  from cudf import DataFrame, Series
  from cudf.core.column import as_column
  from cuspatial import GeoSeries
  from cuspatial._lib.trajectory import derive_trajectories, trajectory_bounding_boxes, trajectory_distances_and_speeds
  from cuspatial.utils.column_utils import contains_only_points, normalize_timestamp_column
label_desc: Use image node_id 1 for calling a global function with example usage: derive_trajectories(object_ids, points, timestamps) and returns: DataFrame,  Series