def __init__(self, filename, flag):
        """Constructor for the LMDBNoLockDatabase class.

        Args:
            filename (str): The filename of the database file.
            flag (str): a flag indicating the mode for opening the database.
                Refer to the documentation for anydbm.open().
        """
        super(LMDBNoLockDatabase, self).__init__()

        create = bool(flag == 'c')

        if flag == 'n':
            if os.path.isfile(filename):
                os.remove(filename)
            create = True

        self._lmdb = lmdb.Environment(
            path=filename,
            map_size=1024**4,
            map_async=True,
            writemap=True,
            readahead=False,
            subdir=False,
            create=create,
            lock=True)
def __init__ ( self , filename , flag ) : super ( LMDBNoLockDatabase , self ) . __init__ ( ) create = bool ( flag == 'c' ) if flag == 'n' : if os . path . isfile ( filename ) : os . remove ( filename ) create = True self . _lmdb = lmdb . Environment ( path = filename , map_size = 1024 ** 4 , map_async = True , writemap = True , readahead = False , subdir = False , create = create , lock = True )
Constructor for the LMDBNoLockDatabase class.

        Args:
            filename (str): The filename of the database file.
            flag (str): a flag indicating the mode for opening the database.
                Refer to the documentation for anydbm.open().