code: def describe_timeseries(df, time_col):
      """Checks if a time series consists of equal time increments
      and if it is in increasing order.
  
      :param df: data.frame which includes the time column in datetime format
      :param time_col: time column
  
      :return: a dictionary with following items
  
          - dataframe ("df") with added delta columns
          - "regular_increments" booleans to see if time deltas as the same
          - "increasing" a boolean to denote if the time increments are increasing
          - "min_timestamp": minimum timestamp in data
          - "max_timestamp": maximum timestamp in data
          - "mean_increment_secs": mean of increments in seconds
          - "min_increment_secs": minimum of increments in seconds
          - "median_increment_secs": median of increments in seconds
          - "mean_delta": mean of time increments
          - "min_delta": min of the time increments
          - "max_delta": max of the time increments
          - "median_delta": median of the time increments
          - "freq_in_secs": the frequency of the timeseries in seconds which is defined to be the median time-gap
          - "freq_in_days": the frequency of the timeseries in days which is defined to be the median time-gap
          - "freq_in_timedelta": the frequency of the timeseries in `datetime.timedelta` which is defined to be the median time-gap
  
      """
      df = df.copy(deep=True)
      df[time_col] = pd.to_datetime(df[time_col])
      if df.shape[0] < 2:
          raise Exception("dataframe needs to have at least two rows")
      df["delta"] = (df[time_col] - df[time_col].shift()).fillna(
          pd.Timedelta(seconds=0)
      )
      df["delta_sec"] = df["delta"].values / np.timedelta64(1, "s")
  
      delta_sec = df["delta_sec"][1:]
      mean_increment_secs = np.mean(delta_sec)
      min_increment_secs = min(delta_sec)
      median_increment_secs = np.median(delta_sec)
      regular_increments = max(delta_sec) == min(delta_sec)
      increasing = min(delta_sec > 0)
      min_timestamp = df[time_col].min()
      max_timestamp = df[time_col].max()
  
      delta = df["delta"][1:]
      min_delta = min(delta)
      max_delta = max(delta)
      mean_delta = np.mean(delta)
      median_delta = np.median(delta)
  
      # The frequency is defined by the median time-gap
      freq_in_secs = median_increment_secs
      freq_in_days = freq_in_secs / (24 * 3600)
      freq_in_timedelta = datetime.timedelta(days=freq_in_days)
  
      return {
          "df": df,
          "regular_increments": regular_increments,
          "increasing": increasing,
          "min_timestamp": min_timestamp,
          "max_timestamp": max_timestamp,
          "mean_increment_secs": mean_increment_secs,
          "min_increment_secs": min_increment_secs,
          "median_increment_secs": median_increment_secs,
          "mean_delta": mean_delta,
          "median_delta": median_delta,
          "min_delta": min_delta,
          "max_delta": max_delta,
          "freq_in_secs": freq_in_secs,
          "freq_in_days": freq_in_days,
          "freq_in_timedelta": freq_in_timedelta,
      }
  
file_path: greykite/greykite/common/time_properties.py
imports: import datetime
  import warnings
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Union
  import numpy
  import pandas
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.features.adjust_anomalous_data import adjust_anomalous_data
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
label_desc: Use image node_id 1 for calling a global function with example usage: describe_timeseries(df, time_col) and returns: dict