def _import_db(engine=SQLITE):
 global MySQLdb
 global sqlite
 if (engine == MYSQL):
  import MySQLdb
  warnings.simplefilter('ignore', MySQLdb.Warning)
 if (engine == SQLITE):
  try:
   import sqlite3.dbapi2 as sqlite
  except:
   import pysqlite2.dbapi2 as sqlite

def _import_db ( engine = SQLITE ) : global MySQLdb global sqlite if ( engine == MYSQL ) : import MySQLdb warnings . simplefilter ( 'ignore' , MySQLdb . Warning ) if ( engine == SQLITE ) : try : import sqlite3 . dbapi2 as sqlite except : import pysqlite2 . dbapi2 as sqlite
lazy import called from database() or database .