<s> import shutil <EOL> import tempfile <EOL> import warnings <EOL> try : <EOL> from bsddb3 import db <EOL> except ImportError : <EOL> from bsddb import db <EOL> env_name = tempfile . mkdtemp ( ) <EOL> class Context : <EOL> def __init__ ( self ) : <EOL> self . env = db . DBEnv ( ) <EOL> self . env . open ( env_name , <EOL> db . DB_CREATE | db . DB_INIT_TXN | db . DB_INIT_MPOOL ) <EOL> self . the_txn = self . env . txn_begin ( ) <EOL> self . map = db . DB ( self . env ) <EOL> self . map . open ( '<STR_LIT>' , "<STR_LIT:p>" , <EOL> db . DB_HASH , db . DB_CREATE , <NUM_LIT:0> <NUM_LIT> , txn = self . the_txn ) <EOL> del self . env <EOL> del self . the_txn <EOL> warnings . filterwarnings ( '<STR_LIT:ignore>' , '<STR_LIT>' ) <EOL> try : <EOL> context = Context ( ) <EOL> del context <EOL> finally : <EOL> warnings . resetwarnings ( ) <EOL> try : <EOL> shutil . rmtree ( env_name ) <EOL> except EnvironmentError : <EOL> pass </s>
