# Path: taskflow/test.py
# class GreaterThanEqual(object):
# class FailureRegexpMatcher(object):
# class ItemsEqual(object):
# class TestCase(base.BaseTestCase):
#         class ReRaiseOtherTypes(object):
#         class CaptureMatchee(object):
# class MockTestCase(TestCase):
# class CapturingLoggingHandler(logging.Handler):
#     def __init__(self, source):
#     def match(self, other):
#     def __init__(self, exc_class, pattern):
#     def match(self, failure):
#     def __init__(self, seq):
#     def match(self, other):
#     def makeTmpDir(self):
#     def assertDictEqual(self, expected, check):
#     def assertRaisesAttrAccess(self, exc_class, obj, attr_name):
#         def access_func():
#     def assertRaisesRegex(self, exc_class, pattern, callable_obj,
#                           *args, **kwargs):
#             def match(self, matchee):
#             def match(self, matchee):
#     def assertGreater(self, first, second):
#     def assertGreaterEqual(self, first, second):
#     def assertRegexpMatches(self, text, pattern):
#     def assertIsSuperAndSubsequence(self, super_seq, sub_seq, msg=None):
#     def assertFailuresRegexp(self, exc_class, pattern, callable_obj, *args,
#                              **kwargs):
#     def assertCountEqual(self, seq1, seq2, msg=None):
#     def setUp(self):
#     def patch(self, target, autospec=True, **kwargs):
#     def patchClass(self, module, name, autospec=True, attach_as=None):
#     def resetMasterMock(self):
#     def __init__(self, level=logging.DEBUG):
#     def counts(self):
#     def messages(self):
#     def exc_infos(self):
#     def emit(self, record):
#     def reset(self):
#     def close(self):
# 
# Path: taskflow/types/graph.py
# def _common_format(g, edge_notation):
#     def __init__(self, incoming_graph_data=None, name=''):
#     def freeze(self):
#     def export_to_dot(self):
#     def pformat(self):
#     def add_edge(self, u, v, attr_dict=None, **attr):
#     def add_node(self, n, attr_dict=None, **attr):
#     def fresh_copy(self):
#     def __init__(self, incoming_graph_data=None, name=''):
#     def freeze(self):
#     def get_edge_data(self, u, v, default=None):
#     def topological_sort(self):
#     def pformat(self):
#     def export_to_dot(self):
#     def is_directed_acyclic(self):
#     def no_successors_iter(self):
#     def no_predecessors_iter(self):
#     def bfs_predecessors_iter(self, n):
#     def add_edge(self, u, v, attr_dict=None, **attr):
#     def add_node(self, n, attr_dict=None, **attr):
#     def fresh_copy(self):
#     def fresh_copy(self):
#     def fresh_copy(self):
# def merge_graphs(graph, *graphs, **kwargs):
# class Graph(nx.Graph):
# class DiGraph(nx.DiGraph):
# class OrderedDiGraph(DiGraph):
# class OrderedGraph(Graph):
# 
# Path: taskflow/types/sets.py
# def _merge_in(target, iterable=None, sentinel=_sentinel):
#     def __init__(self, iterable=None):
#     def __hash__(self):
#     def __contains__(self, value):
#     def __len__(self):
#     def __iter__(self):
#     def __setstate__(self, items):
#     def __getstate__(self):
#     def __repr__(self):
#     def copy(self):
#     def intersection(self, *sets):
#         def absorb_it(sets):
#     def issuperset(self, other):
#     def issubset(self, other):
#     def difference(self, *sets):
#         def absorb_it(sets):
#     def union(self, *sets):
# class OrderedSet(abc.Set, abc.Hashable):


import networkx as nx
from six.moves import cPickle as pickle
from taskflow import test
from taskflow.types import graph
from taskflow.types import sets
from taskflow.types import timing
from taskflow.types import tree
        things = list([n.item for n in it])
        self.assertEqual(['mammal', 'reptile', 'horse',
                          'primate', 'monkey', 'human'], things)

    def test_to_diagraph(self):
        root = self._make_species()
        g = root.to_digraph()
        self.assertEqual(root.child_count(only_direct=False) + 1, len(g))
        for node in root.dfs_iter(include_self=True):
            self.assertIn(node.item, g)
        self.assertEqual([], list(g.predecessors('animal')))
        self.assertEqual(['animal'], list(g.predecessors('reptile')))
        self.assertEqual(['primate'], list(g.predecessors('human')))
        self.assertEqual(['mammal'], list(g.predecessors('primate')))
        self.assertEqual(['animal'], list(g.predecessors('mammal')))
        self.assertEqual(['mammal', 'reptile'], list(g.successors('animal')))

    def test_to_digraph_retains_metadata(self):
        root = tree.Node("chickens", alive=True)
        dead_chicken = tree.Node("chicken.1", alive=False)
        root.add(dead_chicken)
        g = root.to_digraph()
        self.assertEqual(g.nodes['chickens'], {'alive': True})
        self.assertEqual(g.nodes['chicken.1'], {'alive': False})


class OrderedSetTest(test.TestCase):

    def test_pickleable(self):
        items = [10, 9, 8, 7]

# Path: taskflow/test.py
# class GreaterThanEqual(object):
# class FailureRegexpMatcher(object):
# class ItemsEqual(object):
# class TestCase(base.BaseTestCase):
#         class ReRaiseOtherTypes(object):
#         class CaptureMatchee(object):
# class MockTestCase(TestCase):
# class CapturingLoggingHandler(logging.Handler):
#     def __init__(self, source):
#     def match(self, other):
#     def __init__(self, exc_class, pattern):
#     def match(self, failure):
#     def __init__(self, seq):
#     def match(self, other):
#     def makeTmpDir(self):
#     def assertDictEqual(self, expected, check):
#     def assertRaisesAttrAccess(self, exc_class, obj, attr_name):
#         def access_func():
#     def assertRaisesRegex(self, exc_class, pattern, callable_obj,
#                           *args, **kwargs):
#             def match(self, matchee):
#             def match(self, matchee):
#     def assertGreater(self, first, second):
#     def assertGreaterEqual(self, first, second):
#     def assertRegexpMatches(self, text, pattern):
#     def assertIsSuperAndSubsequence(self, super_seq, sub_seq, msg=None):
#     def assertFailuresRegexp(self, exc_class, pattern, callable_obj, *args,
#                              **kwargs):
#     def assertCountEqual(self, seq1, seq2, msg=None):
#     def setUp(self):
#     def patch(self, target, autospec=True, **kwargs):
#     def patchClass(self, module, name, autospec=True, attach_as=None):
#     def resetMasterMock(self):
#     def __init__(self, level=logging.DEBUG):
#     def counts(self):
#     def messages(self):
#     def exc_infos(self):
#     def emit(self, record):
#     def reset(self):
#     def close(self):
# 
# Path: taskflow/types/graph.py
# def _common_format(g, edge_notation):
#     def __init__(self, incoming_graph_data=None, name=''):
#     def freeze(self):
#     def export_to_dot(self):
#     def pformat(self):
#     def add_edge(self, u, v, attr_dict=None, **attr):
#     def add_node(self, n, attr_dict=None, **attr):
#     def fresh_copy(self):
#     def __init__(self, incoming_graph_data=None, name=''):
#     def freeze(self):
#     def get_edge_data(self, u, v, default=None):
#     def topological_sort(self):
#     def pformat(self):
#     def export_to_dot(self):
#     def is_directed_acyclic(self):
#     def no_successors_iter(self):
#     def no_predecessors_iter(self):
#     def bfs_predecessors_iter(self, n):
#     def add_edge(self, u, v, attr_dict=None, **attr):
#     def add_node(self, n, attr_dict=None, **attr):
#     def fresh_copy(self):
#     def fresh_copy(self):
#     def fresh_copy(self):
# def merge_graphs(graph, *graphs, **kwargs):
# class Graph(nx.Graph):
# class DiGraph(nx.DiGraph):
# class OrderedDiGraph(DiGraph):
# class OrderedGraph(Graph):
# 
# Path: taskflow/types/sets.py
# def _merge_in(target, iterable=None, sentinel=_sentinel):
#     def __init__(self, iterable=None):
#     def __hash__(self):
#     def __contains__(self, value):
#     def __len__(self):
#     def __iter__(self):
#     def __setstate__(self, items):
#     def __getstate__(self):
#     def __repr__(self):
#     def copy(self):
#     def intersection(self, *sets):
#         def absorb_it(sets):
#     def issuperset(self, other):
#     def issubset(self, other):
#     def difference(self, *sets):
#         def absorb_it(sets):
#     def union(self, *sets):
# class OrderedSet(abc.Set, abc.Hashable):


# Path: taskflow/tests/unit/test_types.py
import networkx as nx
from six.moves import cPickle as pickle
from taskflow import test
from taskflow.types import graph
from taskflow.types import sets
from taskflow.types import timing
from taskflow.types import tree

        things = list([n.item for n in it])
        self.assertEqual(['mammal', 'reptile', 'horse',
                          'primate', 'monkey', 'human'], things)

    def test_to_diagraph(self):
        root = self._make_species()
        g = root.to_digraph()
        self.assertEqual(root.child_count(only_direct=False) + 1, len(g))
        for node in root.dfs_iter(include_self=True):
            self.assertIn(node.item, g)
        self.assertEqual([], list(g.predecessors('animal')))
        self.assertEqual(['animal'], list(g.predecessors('reptile')))
        self.assertEqual(['primate'], list(g.predecessors('human')))
        self.assertEqual(['mammal'], list(g.predecessors('primate')))
        self.assertEqual(['animal'], list(g.predecessors('mammal')))
        self.assertEqual(['mammal', 'reptile'], list(g.successors('animal')))

    def test_to_digraph_retains_metadata(self):
        root = tree.Node("chickens", alive=True)
        dead_chicken = tree.Node("chicken.1", alive=False)
        root.add(dead_chicken)
        g = root.to_digraph()
        self.assertEqual(g.nodes['chickens'], {'alive': True})
        self.assertEqual(g.nodes['chicken.1'], {'alive': False})


class OrderedSetTest(test.TestCase):

    def test_pickleable(self):
        items = [10, 9, 8, 7]

        s = sets.OrderedSet(items)