class_docstr: S3Payload class
class_docstr_tok: ["S3Payload","class"]
docstr: Pre-parsing method for S3 objects
  
  Downloads the s3 object into the system's temp directory for reading. The
  file is kept open as a tempfile.TemporaryFile to ensure proper cleanup
  when reading finishes.
  
  Yields:
      Instances of PayloadRecord back to the caller containing the current log data
docstr_tok: ["Pre-parsing","method","for","S3","objects","Downloads","the","s3","object","into","the","system","'s","temp","directory","for","reading",".","The","file","is","kept","open","as","a","tempfile.TemporaryFile","to","ensure","proper","cleanup","when","reading","finishes",".","Yields",":","Instances","of","PayloadRecord","back","to","the","caller","containing","the","current","log","data"]
code: def _pre_parse(self):
      """Pre-parsing method for S3 objects
  
      Downloads the s3 object into the system's temp directory for reading. The
      file is kept open as a tempfile.TemporaryFile to ensure proper cleanup
      when reading finishes.
  
      Yields:
          Instances of PayloadRecord back to the caller containing the current log data
      """
      if not self._check_size():
          return  # _check_size can raise an exception as well
  
      line_num = 0
      for line_num, data in self._read_file():
          yield PayloadRecord(data)
  
      MetricLogger.log_metric(
          FUNCTION_NAME, MetricLogger.TOTAL_S3_RECORDS, line_num
      )
  
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 14 for calling the S3Payload obj's underlying member method code with example usage: obj._pre_parse() without return types