code: def get_delta(df: pd.DataFrame, tss) -> Tuple[Dict, Dict, Dict]:
      """
      Infer the sampling interval of each time series, by picking the most popular time interval observed in the training data.
  
      :param df: Dataframe with time series data.
      :param tss: timeseries settings
  
      :return:
      Dictionary with group combination tuples as keys. Values are dictionaries with the inferred delta for each series.
      """  # noqa
      df = df.copy()  # TODO: necessary?
      original_col = f"__mdb_original_{tss.order_by}"
      order_col = (
          original_col if original_col in df.columns else tss.order_by
      )
      deltas = {
          "__default": df[order_col]
          .astype(float)
          .diff()
          .value_counts()
          .index[0]
      }
      freq, period = detect_freq_period(
          deltas["__default"], tss, len(df)
      )
      periods = {"__default": [period]}
      freqs = {"__default": freq}
  
      if tss.group_by:
          grouped = df.groupby(by=tss.group_by)
          for group, subset in grouped:
              if subset.shape[0] > 1:
                  deltas[group] = (
                      subset[order_col].diff().value_counts().index[0]
                  )
                  freq, period = detect_freq_period(
                      deltas[group], tss, len(subset)
                  )
                  freqs[group] = freq
                  periods[group] = (
                      [period] if period is not None else [1]
                  )
              else:
                  deltas[group] = 1.0
                  periods[group] = [1]
                  freqs[group] = "S"
  
      return deltas, periods, freqs
  
file_path: lightwood/lightwood/helpers/ts.py
imports: from typing import Tuple, Dict
  from datetime import datetime
  import numpy
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: get_delta(df, tss) and returns: deltas,  periods,  freqs