def validity(*vs):
    """
    Return the intersection of the validity periods for the given inputs.
    :param vs: iterable of objects with `not_before` and `not_after` datetime members
    """
    not_before = max(v.not_before for v in vs if v is not None and v.not_before)
    not_after = min(v.not_after for v in vs if v is not None and v.not_after)
    return not_before, not_after