def get_X_Y(**cosmo):
    """The fraction of baryonic mass in hydrogen and helium.

    Assumes X_H + Y_He = 1.

    You must specify either 'X_H', or 'Y_He', or both.
    """
    if 'X_H' in cosmo and 'Y_He' not in cosmo:
        X_H = cosmo['X_H']
        Y_He = 1. - X_H
    elif 'Y_He' in cosmo and 'X_H' not in cosmo:
        Y_He = cosmo['Y_He']
        X_H = 1. - Y_He
    else:
        X_H = cosmo['X_H']
        Y_He = cosmo['Y_He']
    return X_H, Y_He