@classmethod
def from_raw(cls, raw):
    """Return the corresponding KeepAlive."""
    if raw is None:
        return None
    elif isinstance(raw, cls):
        return raw
    elif isinstance(raw, (str, int, float)):
        return cls(raw)
    else:
        try:
            raw = dict(raw)
        except TypeError:
            return cls(*raw)
        else:
            return cls(**raw)
