(
        sds,
        replica_set_name,
        server_description)
return _check_has_primary(sds)
RS with known primary. Process a response from a non-primary.

    Pass in a dict of ServerDescriptions, current replica set name, and the
    ServerDescription we are processing.

    Returns new topology type.
RS with known primary. Process a response from a non-primary.
RS with known primary . Process a response from a non - primary .
def _update_rs_with_primary_from_member(
        sds,
        replica_set_name,
        server_description):
    """RS with known primary. Process a response from a non-primary.

    Pass in a dict of ServerDescriptions, current replica set name, and the
    ServerDescription we are processing.

    Returns new topology type.
    """
    assert replica_set_name is not None

    if replica_set_name != server_description.replica_set_name:
        sds.pop(server_description.address)
    elif (server_description.me and
          server_description.address != server_description.me):
        sds.pop(server_description.address)

    # Had this member been the primary?
    return _check_has_primary(sds)
def _update_rs_with_primary_from_member ( sds , replica_set_name , server_description ) : assert replica_set_name is not None if replica_set_name != server_description . replica_set_name : sds . pop ( server_description . address ) elif ( server_description . me and server_description . address != server_description . me ) : sds . pop ( server_description . address ) # Had this member been the primary? return _check_has_primary ( sds )