def disconnect(database=None):
    database = database or proxy_database
    try:
        database.connection.close()
    except __HOLE__:
        if not osfsettings.DEBUG_MODE:
            logger.error('MongoDB client not attached to request.')
dataset/ETHPy150Open CenterForOpenScience/osf.io/framework/transactions/commands.py/disconnect