class_docstr: A class that is responsible for caching objects in-memory.
  
  This class is to intended to be used in the following pattern:
  
  def get(key, default=None):
      if not cache.has(key):
          try:
              data = load_data(key)
              cache.set(key, data)
          except NoSuchKeyException:
              cache.blank(key)
  
      return cache.get(key, default)
class_docstr_tok: ["A","class","that","is","responsible","for","caching","objects","in-memory",".","This","class","is","to","intended","to","be","used","in","the","following","pattern",":","def","get","(","key",",","default=None",")",":","if","not","cache.has","(","key",")",":","try",":","data","=","load_data","(","key",")","cache.set","(","key",",","data",")","except","NoSuchKeyException",":","cache.blank","(","key",")","return","cache.get","(","key",",","default",")"]
docstr: As set(), but replaces the entire set of currently cached values with a new data set.
  
  (!) NOTE: This disregards the maximum_key_count option.
  
  Params:
      keyvalue_data (dict)
      ttl_minutes (int)
docstr_tok: ["As","set","(",")",",","but","replaces","the","entire","set","of","currently","cached","values","with","a","new","data","set",".","(","!",")","NOTE",":","This","disregards","the","maximum_key_count","option",".","Params",":","keyvalue_data","(","dict",")","ttl_minutes","(","int",")"]
code: def setall(self, keyvalue_data, ttl_minutes):
      """
      As set(), but replaces the entire set of currently cached values with a new data set.
  
      (!) NOTE: This disregards the maximum_key_count option.
  
      Params:
          keyvalue_data (dict)
          ttl_minutes (int)
      """
      if not keyvalue_data:
          self._data = {}
          self._ttls = {}
          return
  
      self._data = keyvalue_data
      ttl = self._clock.utcnow() + timedelta(minutes=ttl_minutes)
      for key in keyvalue_data.keys():
          self._ttls[key] = ttl
  
file_path: streamalert/streamalert/shared/lookup_tables/cache.py
imports: import copy
  from datetime import datetime, timedelta
  import random
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 7 for calling the DriverCache obj's underlying member method code with example usage: obj.setall(keyvalue_data, ttl_minutes) without return types