code: def pop_trigger(data):
      
  
      trigger_name = data.pop('trigger')
      trigger_args = {}
  
      if trigger_name == 'date':
          trigger_arg_names = ('run_date', 'timezone')
      elif trigger_name == 'interval':
          trigger_arg_names = ('weeks', 'days', 'hours', 'minutes', 'seconds', 'start_date', 'end_date', 'timezone')
      elif trigger_name == 'cron':
          trigger_arg_names = ('year', 'month', 'day', 'week', 'day_of_week', 'hour', 'minute', 'second', 'start_date', 'end_date', 'timezone')
      else:
          raise Exception('Trigger %s is not supported.' % trigger_name)
  
      for arg_name in trigger_arg_names:
          if arg_name in data:
              trigger_args[arg_name] = data.pop(arg_name)
  
      return trigger_name, trigger_args
docs: Pops trigger and trigger args from a given dict.