def _get_random_sex(rng, conf):
    """
    This function returns the sex at birth of the person.
    Other is associated with 'prefer not to answer' for the CanStats census.

    Args:
        rng (): A random number generator

    Returns:
        [str]: Possible choices of sex {female, male, other}
    """
    p = rng.rand()
    if p < conf.get('P_FEMALE'):
        return 'female'
    elif p < conf.get('P_FEMALE') + conf.get('P_MALE'):
        return 'male'
    else:
        return 'other'