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: Returns the datetime time-to-live of the requested key.
  
  Params:
      key (str)
  
  Returns:
      datetime|None
docstr_tok: ["Returns","the","datetime","time-to-live","of","the","requested","key",".","Params",":","key","(","str",")","Returns",":","datetime|None"]
code: def ttl(self, key):
      """
      Returns the datetime time-to-live of the requested key.
  
      Params:
          key (str)
  
      Returns:
          datetime|None
      """
      return self._ttls.get(key, None)
  
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 2 for calling the DriverCache obj's underlying member method code with example usage: obj.ttl(key) and returns: self