code: def quality_check_timeseries_dataframe(
      df, dt_col, id_col=None, repair=True
  ):
      """
      detect the low-quality data and provide suggestion (e.g. call .impute or .resample).
  
      :param df: a pandas dataframe for your raw time series data.
      :param dt_col: a str indicates the col name of datetime
             column in the input data frame, the dt_col must be sorted
             from past to latest respectively for each id.
      :param id_col: (optional) a str indicates the col name of dataframe id. If
             it is not explicitly stated, then the data is interpreted as only
             containing a single id.
      :param repair: a bool indicates whether automaticly repair low quality data.
  
      :return: a bool indicates df whether contains low-quality data.
      """
      invalidInputError(
          dt_col in df.columns,
          f"dt_col {dt_col} can not be found in df.",
      )
      if id_col is not None:
          invalidInputError(
              id_col in df.columns,
              f"id_col {id_col} can not be found in df.",
          )
      invalidInputError(
          pd.isna(df[dt_col]).sum() == 0, "There is N/A in datetime col"
      )
      if df.empty is True:
          return True, df
      flag = True
      # 1. timestamp check
      if _timestamp_type_check(df[dt_col]) is False:
          if repair is True:
              flag = flag and _timestamp_type_repair(df, dt_col)
          else:
              flag = False
  
      # 2. irregular interval check
      if flag is True:
          interval_flag, intervals = _time_interval_check(
              df, dt_col, id_col
          )
          if interval_flag is False:
              if repair is True:
                  df, repair_flag = _time_interval_repair(
                      df, dt_col, intervals, id_col
                  )
                  flag = flag and repair_flag
              else:
                  flag = False
  
      # 3. missing value check
      if _missing_value_check(df, dt_col) is False:
          if repair is True:
              flag = flag and _missing_value_repair(df, dt_col)
          else:
              flag = False
  
      # 4. pattern check and noise check
      # TODO:
  
      # 5. abnormal value check
      _abnormal_value_check(df, dt_col)
  
      return flag, df
  
file_path: BigDL/python/chronos/src/bigdl/chronos/data/utils/quality_inspection.py
imports: import pandas
  import numpy
  from bigdl.nano.utils.common import invalidInputError
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: quality_check_timeseries_dataframe(df, dt_col, id_col, repair) and returns: flag,  df, True,  df