code: def fill_missing_dates(df, time_col=TIME_COL, freq=None):
      """Looks for gaps in df[time_col] and returns a pandas.DataFrame
          with the missing rows added in.
          Warning: if freq doesn't match intended freq, then values may be removed.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          dataframe with column ``time_col``
      time_col: `str`
          time column name, default TIME_COL
      freq: `str`
          timeseries frequency,
          DateOffset alias, default None (automatically inferred)
  
      Returns
      -------
      full_df : `pandas.DataFrame`
          ``df`` with rows added for missing timestamps
      added_timepoints : `int`
          The number of rows added to ``df``
      dropped_timepoints : `int`
          The number of rows removed from ``df``.
          If the timestamps in ``df`` are not evenly spaced,
          irregular timestamps may be removed.
      """
      freq = freq if freq is not None else infer_freq(df, time_col)
      df = df.reset_index(drop=True)
      complete_dates = pd.DataFrame(
          {
              time_col: pd.date_range(
                  start=min(df[time_col]),
                  end=max(df[time_col]),
                  freq=freq,
              )
          }
      )
      full_df = pd.merge(complete_dates, df, how="left", on=time_col)
  
      # counts the timestamps in one but not the other
      before = set(df[time_col].values)
      after = set(full_df[time_col].values)
      added_timepoints = len(after - before)
      dropped_timepoints = len(before - after)
      if added_timepoints > 0:
          log_message(
              f"Added {added_timepoints} missing dates. There were {len(before)} values originally.",
              LoggingLevelEnum.INFO,
          )
      if dropped_timepoints > 0:
          warnings.warn(
              f"Dropped {dropped_timepoints} dates when filling gaps in input data. Provide data frequency"
              f" and make sure data points are evenly spaced."
          )
  
      return full_df, added_timepoints, dropped_timepoints
  
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 4 for calling a global function with example usage: fill_missing_dates(df, time_col, freq) and returns: full_df,  added_timepoints,  dropped_timepoints