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)
 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 ) return _check_has_primary ( sds )
rs with known primary .