

def init_sqlite(url):
    global DB
    dbfile = os.path.join('/', *url.path.split('/'))
    dirname = os.path.dirname(dbfile)
    log.info('Opening sqlite database: %s', dbfile)
    if (not os.path.exists(dirname)):
        os.makedirs(dirname)
    DB.initialize(SqliteDatabase(dbfile))
    log.info("Database initialized as '%s'. Checking migrations...", dbfile)
    return (DB, SqliteMigrator(DB))

dataset/ETHPy150Open mosquito/pypi-server/pypi_server/db/__init__.py init_sqlite/original