def check_NWIS_service(input):
    """Checks that the service is valid: either iv or dv"""
    if input is None:
        return None
    if input == "iv" or input == "dv":
        return input
    else:
        raise TypeError("The NWIS service type accepts 'dv' for daily values, "
                        "or 'iv' for instantaneous values. Actual value: "
                        "{}".format(input))