()
return {
        db_ for db_, delay in delays_by_db.items()
        if 0 <= (-1 if delay is None else delay) <= acceptable_delays_by_db[db_]
    }
:returns: set of database aliases that are configured as standbys and have replication
                 delay below the configured threshold
:returns: set of database aliases that are configured as standbys and have replication
                 delay below the configured threshold
: returns : set of database aliases that are configured as standbys and have replication delay below the configured threshold
def get_standbys_with_acceptible_delay():
    """:returns: set of database aliases that are configured as standbys and have replication
                 delay below the configured threshold
    """
    acceptable_delays_by_db = get_acceptible_replication_delays()
    standbys = get_standby_databases()

    delays_by_db = {}
    if plproxy_standby_config:
        standbys -= set(plproxy_standby_config.form_processing_dbs)
        delays_by_db = get_replication_delay_for_shard_standbys()

    delays_by_db.update({
        db_: get_replication_delay_for_standby(db_)
        for db_ in standbys
    })

    return {
        db_ for db_, delay in delays_by_db.items()
        if 0 <= (-1 if delay is None else delay) <= acceptable_delays_by_db[db_]
    }
def get_standbys_with_acceptible_delay ( ) : acceptable_delays_by_db = get_acceptible_replication_delays ( ) standbys = get_standby_databases ( ) delays_by_db = { } if plproxy_standby_config : standbys -= set ( plproxy_standby_config . form_processing_dbs ) delays_by_db = get_replication_delay_for_shard_standbys ( ) delays_by_db . update ( { db_ : get_replication_delay_for_standby ( db_ ) for db_ in standbys } ) return { db_ for db_ , delay in delays_by_db . items ( ) if 0 <= ( - 1 if delay is None else delay ) <= acceptable_delays_by_db [ db_ ] }