code: def trajectory_distances_and_speeds(
      num_trajectories, object_ids, points: GeoSeries, timestamps
  ):
      """
      Compute the distance traveled and speed of sets of trajectories
  
      Parameters
      ----------
      num_trajectories
          number of trajectories (unique object ids)
      object_ids
          column of object (e.g., vehicle) ids
      points: GeoSeries
          A series of points
      timestamps
          column of timestamps in any resolution
  
      Returns
      -------
      result : cudf.DataFrame
          meters : cudf.Series
              trajectory distance (in kilometers)
          speed  : cudf.Series
              trajectory speed (in meters/second)
  
      Examples
      --------
      Compute the distances and speeds of derived trajectories
  
      >>> objects, traj_offsets = cuspatial.derive_trajectories(...)
      >>> dists_and_speeds = cuspatial.trajectory_distances_and_speeds(
              len(traj_offsets)
              objects['object_id'],
              objects['x'],
              objects['y'],
              objects['timestamp']
          )
      >>> print(dists_and_speeds)
                            distance       speed
          trajectory_id
          0              1414.213562  141.421356
          1              1414.213562  141.421356
      """
  
      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))
      df = DataFrame._from_data(
          *cpp_trajectory_distances_and_speeds(
              num_trajectories, object_ids, xs, ys, timestamps
          )
      )
      df.index.name = "trajectory_id"
      return df
  
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 3 for calling a global function with example usage: trajectory_distances_and_speeds(num_trajectories, object_ids, points, timestamps) and returns: df