def init_db(drop_all=False, bind=engine):
try:<EOL><INDENT>if drop_all:<EOL><INDENT>Base.metadata.drop_all(bind=bind)<EOL><DEDENT>Base.metadata.create_all(bind=bind)<EOL><DEDENT>except OperationalError as err:<EOL><INDENT>msg = '<STR_LIT>'<EOL>if msg in err.message:<EOL><INDENT>sys.stderr.write(db_user_warning)<EOL><DEDENT>raise<EOL><DEDENT>return session<EOL>
Initialize the database, optionally dropping existing tables.