original_docstring: 
      Long running execution of fetching incidents from QRadar service.
      Will continue to fetch in an infinite loop offenses from QRadar,
      Enriching each offense with events/IPs/assets according to the
      configurations given in Demisto params.
      transforming the offenses into incidents and sending them to Demisto
      to save the incidents.
      Args:
          client (Client): Client to perform API calls.
          params (Dict): Demisto params.
  
      
docstring: Long running execution of fetching incidents from QRadar service.
  Will continue to fetch in an infinite loop offenses from QRadar,
  Enriching each offense with events/IPs/assets according to the
  configurations given in Demisto params.
  transforming the offenses into incidents and sending them to Demisto
  to save the incidents.
docstring_tokens: Long running execution of fetching incidents from QRadar service . Will continue to fetch in an infinite loop offenses from QRadar Enriching each offense with events / IPs / assets according to the configurations given in Demisto params . transforming the offenses into incidents and sending them to Demisto to save the incidents .
code: def long_running_execution_command(client: Client, params: Dict):
      """
      Long running execution of fetching incidents from QRadar service.
      Will continue to fetch in an infinite loop offenses from QRadar,
      Enriching each offense with events/IPs/assets according to the
      configurations given in Demisto params.
      transforming the offenses into incidents and sending them to Demisto
      to save the incidents.
      Args:
          client (Client): Client to perform API calls.
          params (Dict): Demisto params.
  
      """
      fetch_mode = params.get('fetch_mode', FETCH_MODE_DEFAULT_VALUE)
      ip_enrich, asset_enrich = get_offense_enrichment(params.get('enrichment', 'IPs And Assets'))
      offenses_per_fetch = int(params.get('offenses_per_fetch', DEFAULT_OFFENSES_PER_FETCH))
      user_query = params.get('query', '')
      events_columns = params.get('events_columns', EVENT_COLUMNS_DEFAULT_VALUE)
      events_limit = int(params.get('events_limit', DEFAULT_EVENTS_LIMIT))
      incident_type = params.get('incident_type')
      mirror_direction = MIRROR_DIRECTION.get(params.get('mirror_options', DEFAULT_MIRRORING_DIRECTION))
      while True:
          try:
              is_reset_triggered(handle_reset=True)
              ctx = get_integration_context()
              print_debug_msg(f'Starting fetch loop. Fetch mode: {fetch_mode}.')
              incidents, new_highest_id = get_incidents_long_running_execution(
                  client=client,
                  offenses_per_fetch=offenses_per_fetch,
                  user_query=user_query,
                  fetch_mode=fetch_mode,
                  events_columns=events_columns,
                  events_limit=events_limit,
                  ip_enrich=ip_enrich,
                  asset_enrich=asset_enrich,
                  last_highest_id=ctx.get(LAST_FETCH_KEY, 0),
                  incident_type=incident_type,
                  mirror_direction=mirror_direction
              )
              # Reset was called during execution, skip creating incidents.
              if not incidents and not new_highest_id:
                  continue
  
              incident_batch_for_sample = incidents if incidents else ctx.get('samples', [])
              set_integration_context({LAST_FETCH_KEY: new_highest_id, 'samples': incident_batch_for_sample,
                                       'last_mirror_update': ctx.get('last_mirror_update')})
  
              demisto.createIncidents(incidents)
  
          except Exception as e:
              demisto.error(str(e))
  
          finally:
              time.sleep(FETCH_SLEEP)
code_tokens: def long_running_execution_command ( client : Client , params : Dict ) : fetch_mode = params . get ( 'fetch_mode' , FETCH_MODE_DEFAULT_VALUE ) ip_enrich , asset_enrich = get_offense_enrichment ( params . get ( 'enrichment' , 'IPs And Assets' ) ) offenses_per_fetch = int ( params . get ( 'offenses_per_fetch' , DEFAULT_OFFENSES_PER_FETCH ) ) user_query = params . get ( 'query' , '' ) events_columns = params . get ( 'events_columns' , EVENT_COLUMNS_DEFAULT_VALUE ) events_limit = int ( params . get ( 'events_limit' , DEFAULT_EVENTS_LIMIT ) ) incident_type = params . get ( 'incident_type' ) mirror_direction = MIRROR_DIRECTION . get ( params . get ( 'mirror_options' , DEFAULT_MIRRORING_DIRECTION ) ) while True : try : is_reset_triggered ( handle_reset = True ) ctx = get_integration_context ( ) print_debug_msg ( f'Starting fetch loop. Fetch mode: {fetch_mode}.' ) incidents , new_highest_id = get_incidents_long_running_execution ( client = client , offenses_per_fetch = offenses_per_fetch , user_query = user_query , fetch_mode = fetch_mode , events_columns = events_columns , events_limit = events_limit , ip_enrich = ip_enrich , asset_enrich = asset_enrich , last_highest_id = ctx . get ( LAST_FETCH_KEY , 0 ) , incident_type = incident_type , mirror_direction = mirror_direction ) if not incidents and not new_highest_id : continue incident_batch_for_sample = incidents if incidents else ctx . get ( 'samples' , [ ] ) set_integration_context ( { LAST_FETCH_KEY : new_highest_id , 'samples' : incident_batch_for_sample , 'last_mirror_update' : ctx . get ( 'last_mirror_update' ) } ) demisto . createIncidents ( incidents ) except Exception as e : demisto . error ( str ( e ) ) finally : time . sleep ( FETCH_SLEEP )
short_docstring: Long running execution of fetching incidents from QRadar service.
short_docstring_tokens: Long running execution of fetching incidents from QRadar service .
comment: """
      Long running execution of fetching incidents from QRadar service.
      Will continue to fetch in an infinite loop offenses from QRadar,
      Enriching each offense with events/IPs/assets according to the
      configurations given in Demisto params.
      transforming the offenses into incidents and sending them to Demisto
      to save the incidents.
      Args:
          client (Client): Client to perform API calls.
          params (Dict): Demisto params.
  
      """$SEP$# Reset was called during execution, skip creating incidents.