def checkmember(value, values, msg=''):
    """Check value for membership; raise ValueError if fails."""
    if value not in values:
        raise ValueError(f'ERROR {msg}: {value} should be in {values}')
