code: def test_segments_args(dataset, date_col, num_of_segments, request):
      df = request.getfixturevalue(dataset)
      date_array = df[date_col]
      knot_idx = get_knot_idx(
          num_of_obs=df.shape[0], num_of_segments=num_of_segments
      )
      assert knot_idx[0] == 0
      assert len(knot_idx) == num_of_segments + 1
      freq = pd.infer_freq(date_array)
      knot_dates = get_knot_dates(date_array[0], knot_idx, freq)
      # first knot always at the first date
      assert knot_dates[0] == date_array[0]
  
imports: import pytest
  import numpy
  import pandas
  from orbit.utils.knots import get_knot_idx, get_knot_dates
label_desc: Use image node_id 1 for calling a global function with example usage: test_segments_args(dataset, date_col, num_of_segments, request) without return types