def get_switch(self, key, default_val):
    val = self.values.get(key)
    if ((val is not None) and (val.lower() == 'y')):
        return True
    elif ((val is not None) and (val.lower() == 'n')):
        return False
    return default_val
def get_switch(self, key, default_val):
    val = self.values.get(key)
    if ((val is not None) and (val.lower() == 'y')):
        return True
    elif ((val is not None) and (val.lower() == 'n')):
        return False
    return default_val