class_docstr: Encapsulates a single alert and handles serializing to Dynamo and merging.
class_docstr_tok: ["Encapsulates","a","single","alert","and","handles","serializing","to","Dynamo","and","merging","."]
docstr: Check if two alerts can be merged together.
  
  Args:
      other (Alert): Check if the instance can merge with this other alert.
  
  Returns:
      True if these alerts fit in the same merge window and have the same merge key values.
docstr_tok: ["Check","if","two","alerts","can","be","merged","together",".","Args",":","other","(","Alert",")",":","Check","if","the","instance","can","merge","with","this","other","alert",".","Returns",":","True","if","these","alerts","fit","in","the","same","merge","window","and","have","the","same","merge","key","values","."]
code: def can_merge(self, other):
      """Check if two alerts can be merged together.
  
      Args:
          other (Alert): Check if the instance can merge with this other alert.
  
      Returns:
          True if these alerts fit in the same merge window and have the same merge key values.
      """
      if not self.merge_enabled or not other.merge_enabled:
          # Merge information is not defined for both of these alerts.
          return False
  
      older, newer = min(self, other), max(self, other)
      if newer.created > older.created + older.merge_window:
          # These alerts won't fit in a single merge window.
          return False
  
      if set(self.merge_by_keys) != set(other.merge_by_keys):
          # These alerts have different definitions of merge keys.
          return False
  
      return all(
          utils.get_first_key(self.record, key)
          == utils.get_first_key(other.record, key)
          for key in self.merge_by_keys
      )
  
imports: from datetime import datetime, timedelta
  import json
  import uuid
  from streamalert.shared import resources, utils
label_desc: Use image node_id 11 for calling the Alert obj's underlying member method code with example usage: obj.can_merge(other) and returns: all, False, False, False