code: def test_gcd_irregular():
      """Checks sort and fill missing dates"""
      # gaps in unsorted, irregular input
      df = pd.DataFrame(
          {
              TIME_COL: [
                  datetime.datetime(2018, 1, 1, 0, 0, 1),
                  datetime.datetime(2018, 1, 1, 0, 0, 2),
                  datetime.datetime(
                      2018, 1, 1, 0, 0, 10
                  ),  # intentionally out of order
                  datetime.datetime(2018, 1, 1, 0, 0, 4),
              ],
              VALUE_COL: [1, 2, 3, 4],
          }
      )
      expected = pd.DataFrame(
          {
              # in sorted order
              TIME_COL: pd.date_range(
                  start=datetime.datetime(2018, 1, 1, 0, 0, 1),
                  end=datetime.datetime(2018, 1, 1, 0, 0, 10),
                  freq="S",
              ),
              VALUE_COL: [
                  1,
                  2,
                  np.nan,
                  4,
                  np.nan,
                  np.nan,
                  np.nan,
                  np.nan,
                  np.nan,
                  3,
              ],
          }
      )
      expected.index = expected[TIME_COL]
      expected.index.name = None
  
      canonical_data_dict = get_canonical_data(
          df=df, time_col=TIME_COL, value_col=VALUE_COL, freq="S"
      )  # the frequency should be provided when there are gaps
      assert canonical_data_dict["time_stats"]["added_timepoints"] == 6
      assert (
          canonical_data_dict["time_stats"]["dropped_timepoints"] == 0
      )
      assert_equal(canonical_data_dict["df"], expected)
      assert_equal(
          canonical_data_dict["time_stats"]["gaps"],
          find_missing_dates(df[TIME_COL]),
      )
  
imports: import datetime
  import numpy
  import pandas
  import pytest
  from greykite.common.constants import ADJUSTMENT_DELTA_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import METRIC_COL
  from greykite.common.constants import START_TIME_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.data_loader import DataLoader
  from greykite.common.enums import TimeEnum
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_with_reg_for_tests
  from greykite.common.time_properties import describe_timeseries
  from greykite.common.time_properties import fill_missing_dates
  from greykite.common.time_properties import find_missing_dates
  from greykite.common.time_properties import get_canonical_data
  from greykite.common.time_properties import infer_freq
  from greykite.common.time_properties import min_gap_in_seconds
label_desc: Use image node_id 8 for calling a global function with example usage: test_gcd_irregular() without return types