def _check_has_primary(sds):
 for s in sds.values():
  if (s.server_type == SERVER_TYPE.RSPrimary):
   return TOPOLOGY_TYPE.ReplicaSetWithPrimary
 else:
  return TOPOLOGY_TYPE.ReplicaSetNoPrimary

def _check_has_primary ( sds ) : for s in sds . values ( ) : if ( s . server_type == SERVER_TYPE . RSPrimary ) : return TOPOLOGY_TYPE . ReplicaSetWithPrimary else : return TOPOLOGY_TYPE . ReplicaSetNoPrimary
current topology type is replicasetwithprimary .