from __future__ import absolute_import, division, print_function
from collections import Iterator

def raises(err, lamda):
    try:
        lamda()
        return False
    except err:
        return True


def deepmap(func, *seqs):
    """ Apply function inside nested lists

    >>> inc = lambda x: x + 1
    >>> deepmap(inc, [[1, 2], [3, 4]])
    [[2, 3], [4, 5]]

    >>> add = lambda x, y: x + y
    >>> deepmap(add, [[1, 2], [3, 4]], [[10, 20], [30, 40]])
    [[11, 22], [33, 44]]
    """
    if isinstance(seqs[0], (list, Iterator)):
        return [deepmap(func, *items) for items in zip(*seqs)]
    else:
        return func(*seqs)

@@ -58,16 +58,17 @@
 unction%0A
+%0A
 from col
@@ -91,16 +91,54 @@
 Iterator
+%0Afrom contextlib import contextmanager
 %0A%0Adef ra
@@ -673,8 +673,112 @@
 (*seqs)%0A
+%0A%0A@contextmanager%0Adef ignoring(*exceptions):%0A    try:%0A        yield%0A    except exceptions:%0A        pass%0A

add ignoring context manager