docs: def deserialize_records(records):
      """
      This properly deserializes records depending on where they came from:
          - SQS
          - SNS
      """
      native_records = []
      for record in records:
          parsed = json.loads(record['body'])
  
          # Is this a DynamoDB stream event?
          if isinstance(parsed, str):
              native_records.append(json.loads(parsed))
  
          # Is this a subscription message from SNS? If so, skip it:
          elif parsed.get('Type') == 'SubscriptionConfirmation':
              continue
  
          # Is this from SNS (cross-region request -- SNS messages wrapped in SQS message) -- or an SNS proxied message?
          elif parsed.get('Message'):
              native_records.append(json.loads(parsed['Message']))
  
          else:
              native_records.append(parsed)
  
      return native_records