class_docstr: S3Payload class
class_docstr_tok: ["S3Payload","class"]
docstr: Cleanup method to remove all objects in the Lambda container's temp directory
docstr_tok: ["Cleanup","method","to","remove","all","objects","in","the","Lambda","container","'s","temp","directory"]
code: def _cleanup():
      """Cleanup method to remove all objects in the Lambda container's temp directory"""
      # Do nothing if this is not running in AWS Lambda
      if "LAMBDA_RUNTIME_DIR" not in os.environ:
          return
  
      LOGGER.debug("Shredding temp directory")
  
      for root, dirs, files in os.walk(
          tempfile.gettempdir(), topdown=False
      ):
          for name in files:
              subprocess.check_call(
                  [  # nosec
                      "shred",
                      "--force",
                      "--iterations=1",
                      "--remove",
                      os.path.join(root, name),
                  ]
              )
          for name in dirs:
              os.rmdir(os.path.join(root, name))
  
imports: import json
  import logging
  import urllib.request
  import urllib.parse
  import urllib.error
  import gzip
  import os
  import tempfile
  import subprocess
  import time
  import boto3
  from botocore.exceptions import ClientError
  import jsonlines
  from streamalert.classifier.payload.payload_base import PayloadRecord, RegisterInput, StreamPayload
  from streamalert.shared import CLASSIFIER_FUNCTION_NAME
  from streamalert.shared.logger import get_logger
  from streamalert.shared.metrics import MetricLogger
label_desc: Use image node_id 9 for calling the S3Payload obj's underlying member method code with example usage: obj._cleanup() without return types