class_docstr: Encapsulation of encoding algorithms for S3 data.
  
  Right now we only support JSON encoding. In the future, we could potentially support
docstr: Params:
      driver (PersistenceDriver)
      data (string|dict|list|mixed):
  
  Returns: bytes
docstr_tok: ["Params",":","driver","(","PersistenceDriver",")","data","(","string|dict|list|mixed",")",":","Returns",":","bytes"]
code: def json_encode(driver, data):
      """
      Params:
          driver (PersistenceDriver)
          data (string|dict|list|mixed):
  
      Returns: bytes
      """
      try:
          return json.dumps(data).encode()
      except (ValueError, TypeError):
          LOGGER.exception(
              "LookupTable (%s): Failed to json encode data", driver.id
          )
  
imports: import json
  import sys
  import time
  import zlib
  import boto3
  from botocore.exceptions import ClientError, ConnectTimeoutError, ReadTimeoutError
  import streamalert.shared.helpers.boto
  from streamalert.shared.logger import get_logger
  from streamalert.shared.lookup_tables.cache import DriverCache
  from streamalert.shared.lookup_tables.drivers import PersistenceDriver
  from streamalert.shared.lookup_tables.errors import LookupTablesCommitError, LookupTablesInitializationError
label_desc: Use image node_id 1 for calling the Encoding obj's underlying member method code with example usage: obj.json_encode(driver, data) and returns: json