class_docstr: Class to retrieve IOCs from ThreatStream.com and store them in DynamoDB
docstr: Finalize the execution
  
  Send data to dynamo and continue the invocation if necessary.
  
  Arguments:
      intel (list): List of intelligence to send to DynamoDB
      next_url (str): Next token to retrieve more IOCs
      continue_invoke (bool): Whether to retrieve more IOCs from
          threat feed. False if next token is empty or threshold of number
          of IOCs is reached.
docstr_tok: ["Finalize","the","execution","Send","data","to","dynamo","and","continue","the","invocation","if","necessary",".","Arguments",":","intel","(","list",")",":","List","of","intelligence","to","send","to","DynamoDB","next_url","(","str",")",":","Next","token","to","retrieve","more","IOCs","continue_invoke","(","bool",")",":","Whether","to","retrieve","more","IOCs","from","threat","feed",".","False","if","next","token","is","empty","or","threshold","of","number","of","IOCs","is","reached","."]
code: def _finalize(self, intel, next_url):
      """Finalize the execution
  
      Send data to dynamo and continue the invocation if necessary.
  
      Arguments:
          intel (list): List of intelligence to send to DynamoDB
          next_url (str): Next token to retrieve more IOCs
          continue_invoke (bool): Whether to retrieve more IOCs from
              threat feed. False if next token is empty or threshold of number
              of IOCs is reached.
      """
      if intel:
          LOGGER.info("Write %d IOCs to DynamoDB table", len(intel))
          self._write_to_dynamodb_table(intel)
  
      if next_url and self.timing_func() > self._END_TIME_BUFFER * 1000:
          self._invoke_lambda_function(next_url)
  
      LOGGER.debug("Time remaining (MS): %s", self.timing_func())
  
imports: from datetime import datetime, timedelta
  import json
  import backoff
  import boto3
  from botocore.exceptions import ClientError
  import requests
  from streamalert.shared.backoff_handlers import backoff_handler, success_handler, giveup_handler
  from streamalert.shared.config import load_config, parse_lambda_arn
  from streamalert.shared.logger import get_logger
  from streamalert.threat_intel_downloader.exceptions import ThreatStreamCredsError, ThreatStreamLambdaInvokeError, ThreatStreamRequestsError
label_desc: Use image node_id 5 for calling the ThreatStream obj's underlying member method code with example usage: obj._finalize(intel, next_url) without return types