#NEWLINE# def drop_database( self , name_or_db ) : #NEWLINE# #INDENT# def drop_collections_for_db( _db ) : #NEWLINE# #INDENT# for col_name in _db . collection_names ( ) : #NEWLINE# #INDENT# _db . drop_collection ( col_name ) #NEWLINE# #UNINDENT# #UNINDENT# if isinstance ( name_or_db , Database ) : #NEWLINE# #INDENT# databases_keys = list ( self . _databases . keys ( ) ) #NEWLINE# for database_name in databases_keys : #NEWLINE# #INDENT# tmp_database = self . _databases . get ( database_name ) #NEWLINE# if ( tmp_database is name_or_db ) : #NEWLINE# #INDENT# if tmp_database : #NEWLINE# #INDENT# drop_collections_for_db ( tmp_database ) #NEWLINE# #UNINDENT# del self . _databases [ database_name ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( name_or_db in self . _databases ) : #NEWLINE# #INDENT# db = self . _databases [ name_or_db ] #NEWLINE# drop_collections_for_db ( db ) #NEWLINE# del self . _databases [ name_or_db ]