def clean_object_caches(obj):
 global _TYPECLASSMODELS, _OBJECTMODELS
 if (not _TYPECLASSMODELS):
  from evennia.typeclasses import models as _TYPECLASSMODELS
 if (not obj):
  return
 try:
  _SA(obj, '_contents_cache', None)
 except AttributeError:
  pass
 [_DA(obj, cname) for cname in viewkeys(obj.__dict__) if cname.startswith('_cached_db_')]
 try:
  hashid = _GA(obj, 'hashid')
  _TYPECLASSMODELS._ATTRIBUTE_CACHE[hashid] = {}
 except AttributeError:
  pass

def clean_object_caches ( obj ) : global _TYPECLASSMODELS , _OBJECTMODELS if ( not _TYPECLASSMODELS ) : from evennia . typeclasses import models as _TYPECLASSMODELS if ( not obj ) : return try : _SA ( obj , '_contents_cache' , None ) except AttributeError : pass [ _DA ( obj , cname ) for cname in viewkeys ( obj . __dict__ ) if cname . startswith ( '_cached_db_' ) ] try : hashid = _GA ( obj , 'hashid' ) _TYPECLASSMODELS . _ATTRIBUTE_CACHE [ hashid ] = { } except AttributeError : pass
clean all object caches on the given object .