class_docstr: Batcher class to handle segmenting large messages going to the classifier lambda function
docstr: Protected method for sending logs to the classifier lambda
  function for processing. This performs some size checks before sending.
  
  Args:
      source_function (str): The app function name from which the logs came
      logs (list): List of the logs that have been gathered
code: def _send_logs_to_lambda(self, logs):
      """Protected method for sending logs to the classifier lambda
      function for processing. This performs some size checks before sending.
  
      Args:
          source_function (str): The app function name from which the logs came
          logs (list): List of the logs that have been gathered
      """
      # Create a payload to be sent to the classifier function that contains the
      # service these logs were collected from and the list of logs
      payload = {
          "Records": [
              {"streamalert_app": self._source_function, "logs": logs}
          ]
      }
      payload_json = json.dumps(payload, separators=(",", ":"))
      if len(payload_json) > self.MAX_LAMBDA_PAYLOAD_SIZE:
          if len(logs) == 1:
              LOGGER.error(
                  "Log payload size for single log exceeds input limit and will be "
                  "dropped (%d > %d max).",
                  len(payload_json),
                  self.MAX_LAMBDA_PAYLOAD_SIZE,
              )
              return True
  
          LOGGER.debug(
              "Log payload size for %d logs exceeds limit and will be "
              "segmented (%d > %d max).",
              len(logs),
              len(payload_json),
              self.MAX_LAMBDA_PAYLOAD_SIZE,
          )
          return False
  
      LOGGER.debug(
          "Sending %d logs to classifier function with payload size %d",
          len(logs),
          len(payload_json),
      )
  
      try:
          response = Batcher.LAMBDA_CLIENT.invoke(
              FunctionName=self._destination_function,
              InvocationType="Event",
              Payload=payload_json,
              Qualifier="production",
          )
  
      except ClientError as err:
          LOGGER.error(
              "An error occurred while sending logs to "
              "'%s:production'. Error is: %s",
              self._destination_function,
              err.response,
          )
          raise
  
      LOGGER.info(
          "Sent %d logs to '%s' with Lambda request ID '%s'",
          len(logs),
          self._destination_function,
          response["ResponseMetadata"]["RequestId"],
      )
  
      return True
  
file_path: streamalert/streamalert/apps/batcher.py
imports: import json
  import math
  import boto3
  from botocore.exceptions import ClientError
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 4 for calling the Batcher obj's underlying member method code with example usage: obj._send_logs_to_lambda(logs) and returns: True, False, True