def rs_or_single_client(h=host, p=port, **kwargs):
    if client_context.replica_set_name:
        return rs_client(h, p, **kwargs)
    else:
        return single_client(h, p, **kwargs)
Connect to the replica set if there is one, otherwise the standalone.
dataset/ETHPy150Open mongodb/mongo-python-driver/test/utils.py/rs_or_single_client