def isrange(a, b):
    """
    Return True if the passed tuple `(a,b)` is a valid range
    (that is, `a` may not be greater than `b`).
    """
    #~ if r[0] is None or r[1] is None: return True
    #~ if r[0] <= r[1]: return True
    if a is None or b is None:
        return True
    if a <= b:
        return True
    return False