def get_int(self, key, default_val):
    try:
        return int(self.values.get(key))
    except TypeError:
        return default_val
    except ValueError:
        return default_val
def get_int(self, key, default_val):
    try:
        return int(self.values.get(key))
    except TypeError:
        return default_val
    except ValueError:
        return default_val