Convert `b` to an int or list of ints (if `is_listy`); raises exception if not convertible

def to_int(b:Any)->Union[int,List[int]]:
    "Convert `b` to an int or list of ints (if `is_listy`); raises exception if not convertible"
    if is_listy(b): return [to_int(x) for x in b]
    else:          return int(b)