code: def rm_missing_weeks(start_dts, missing_lens, df):
      """
      Drop weeks that contains more than 3 consecutive missing values.
      If consecutive missing values across weeks, we remove all the weeks.
      """
      for start_time, l in zip(start_dts, missing_lens):
          start = start_time - pd.Timedelta(days=start_time.dayofweek)
          start = start.replace(hour=0, minute=0, second=0)
          start_week_end = start + pd.Timedelta(days=6)
          start_week_end = start_week_end.replace(
              hour=22, minute=0, second=0
          )
  
          end_time = start_time + l * pd.Timedelta(hours=2)
          if start_week_end < end_time:
              end = end_time + pd.Timedelta(days=6 - end_time.dayofweek)
              end = end.replace(hour=22, minute=0, second=0)
          else:
              end = start_week_end
          df = df.drop(df[start:end].index)
      return df
  
imports: import pandas
  from zoo.orca import init_orca_context, stop_orca_context
  from zoo.chronos.autots.deprecated.forecast import AutoTSTrainer
  from zoo.chronos.autots.deprecated.config.recipe import *
  from zoo.chronos.autots.deprecated.preprocessing.utils import train_val_test_split
label_desc: Use image node_id 2 for calling a global function with example usage: rm_missing_weeks(start_dts, missing_lens, df) and returns: df