def flush_cache(**kwargs):
 def class_hierarchy(clslist):
  'Recursively yield a class hierarchy'
  for cls in clslist:
   subclass_list = cls.__subclasses__()
   if subclass_list:
    for subcls in class_hierarchy(subclass_list):
     (yield subcls)
   else:
    (yield cls)
 for cls in class_hierarchy([SharedMemoryModel]):
  cls.flush_instance_cache()
 return gc.collect()

def flush_cache ( ** kwargs ) : def class_hierarchy ( clslist ) : for cls in clslist : subclass_list = cls . __subclasses__ ( ) if subclass_list : for subcls in class_hierarchy ( subclass_list ) : ( yield subcls ) else : ( yield cls ) for cls in class_hierarchy ( [ SharedMemoryModel ] ) : cls . flush_instance_cache ( ) return gc . collect ( )
flush idmapper cache .