# Path: cjktools/maps.py
# def chain_mapping(*dictionaries):
# def invert_mapping(dictionary):
# def is_injective(dictionary):
# def invert_injective_mapping(dictionary):
# def map_dict(method, dictionary, in_place=False):
# def multi_dict(input_pairs):
# def procmap(method, item_list):
# def merge_dicts(*args):
# def partial_map(method, object_seq):
# def filtered_map(method, object_list):


import unittest
from cjktools import maps
        ok_list, bad_list = maps.partial_map(to_none, init_list)

        self.assertEqual(ok_list, [])
        self.assertEqual(bad_list, list(range(10)))

    def test_all_ok(self):
        """
        Everthing maps to a true value
        """
        def id(a):
            return a

        init_list = range(1, 11)
        ok_list, bad_list = maps.partial_map(id, init_list)

        self.assertEqual(ok_list, list(init_list), (
            "Expected: %s, got: %s" % (repr(init_list), repr(ok_list))
        ))
        self.assertEqual(bad_list, [])

    def test_partial(self):
        """
        Realistic case, part goes either way
        """
        def kill_even(x):
            if x % 2 == 0:
                return None
            return x*10

        init_list = range(10, 20)

# Path: cjktools/maps.py
# def chain_mapping(*dictionaries):
# def invert_mapping(dictionary):
# def is_injective(dictionary):
# def invert_injective_mapping(dictionary):
# def map_dict(method, dictionary, in_place=False):
# def multi_dict(input_pairs):
# def procmap(method, item_list):
# def merge_dicts(*args):
# def partial_map(method, object_seq):
# def filtered_map(method, object_list):


# Path: cjktools/tests/test_maps.py
import unittest
from cjktools import maps

        ok_list, bad_list = maps.partial_map(to_none, init_list)

        self.assertEqual(ok_list, [])
        self.assertEqual(bad_list, list(range(10)))

    def test_all_ok(self):
        """
        Everthing maps to a true value
        """
        def id(a):
            return a

        init_list = range(1, 11)
        ok_list, bad_list = maps.partial_map(id, init_list)

        self.assertEqual(ok_list, list(init_list), (
            "Expected: %s, got: %s" % (repr(init_list), repr(ok_list))
        ))
        self.assertEqual(bad_list, [])

    def test_partial(self):
        """
        Realistic case, part goes either way
        """
        def kill_even(x):
            if x % 2 == 0:
                return None
            return x*10

        init_list = range(10, 20)

        ok_list, bad_list = maps.partial_map(kill_even, init_list)