def database_exists(name):
    """
    Check if a PostgreSQL database exists.
    """
    with settings(hide('running', 'stdout', 'stderr', 'warnings'),
                  warn_only=True):
        return _run_as_pg(locals() % '''psql -d %(name)s -c ""''').succeeded
dataset/ETHPy150Open ronnix/fabtools/fabtools/postgres.py/database_exists/swapped operands of `%`