from pkpy import next as __pkpy_next def all(iterable): for i in iterable: if not i: return False return True def any(iterable): for i in iterable: if i: return True return False def enumerate(iterable, start=0): n = start for elem in iterable: yield n, elem n += 1 def sum(iterable): res = 0 for i in iterable: res += i return res def map(f, iterable): for i in iterable: yield f(i) def filter(f, iterable): for i in iterable: if f(i): yield i def zip(a, b): a = iter(a) b = iter(b) while True: ai = __pkpy_next(a) bi = __pkpy_next(b) if ai is StopIteration or bi is StopIteration: break yield ai, bi def reversed(iterable): a = list(iterable) a.reverse() return a def sorted(iterable, key=None, reverse=False): a = list(iterable) a.sort(key=key, reverse=reverse) return a ##### str ##### def __format_string(self: str, *args, **kwargs) -> str: def tokenizeString(s: str): tokens = [] L, R = 0,0 mode = None curArg = 0 # lookingForKword = False while(R