def as_int(raw):
    """Return an int for the given raw value.

    Return None for "falsey", non-zero values.
    """
    if raw == 0:
        return 0
    elif not raw:
        return None
    else:
        return int(raw)