# Path: planet/tools/nested.py
# def zip_(*structures, **kwargs):
# def map_(function, *structures, **kwargs):
#   def impl(function, *structures):
# def flatten_(structure):
# def filter_(predicate, *structures, **kwargs):
#   def impl(predicate, *structures):


import collections
import tensorflow as tf
from planet.tools import nested

  def test_empty(self):
    self.assertEqual({}, nested.zip({}, {}))

  def test_base_case(self):
    self.assertEqual((1, 2, 3), nested.zip(1, 2, 3))

  def test_shallow_list(self):
    a = [1, 2, 3]
    b = [4, 5, 6]
    c = [7, 8, 9]
    result = nested.zip(a, b, c)
    self.assertEqual([(1, 4, 7), (2, 5, 8), (3, 6, 9)], result)

  def test_shallow_tuple(self):
    a = (1, 2, 3)
    b = (4, 5, 6)
    c = (7, 8, 9)
    result = nested.zip(a, b, c)
    self.assertEqual(((1, 4, 7), (2, 5, 8), (3, 6, 9)), result)

  def test_shallow_dict(self):
    a = {'a': 1, 'b': 2, 'c': 3}
    b = {'a': 4, 'b': 5, 'c': 6}
    c = {'a': 7, 'b': 8, 'c': 9}
    result = nested.zip(a, b, c)
    self.assertEqual({'a': (1, 4, 7), 'b': (2, 5, 8), 'c': (3, 6, 9)}, result)

  def test_single(self):
    a = [[1, 2], 3]

# Path: planet/tools/nested.py
# def zip_(*structures, **kwargs):
# def map_(function, *structures, **kwargs):
#   def impl(function, *structures):
# def flatten_(structure):
# def filter_(predicate, *structures, **kwargs):
#   def impl(predicate, *structures):


# Path: planet/tools/test_nested.py
import collections
import tensorflow as tf
from planet.tools import nested


  def test_empty(self):
    self.assertEqual({}, nested.zip({}, {}))

  def test_base_case(self):
    self.assertEqual((1, 2, 3), nested.zip(1, 2, 3))

  def test_shallow_list(self):
    a = [1, 2, 3]
    b = [4, 5, 6]
    c = [7, 8, 9]
    result = nested.zip(a, b, c)
    self.assertEqual([(1, 4, 7), (2, 5, 8), (3, 6, 9)], result)

  def test_shallow_tuple(self):
    a = (1, 2, 3)
    b = (4, 5, 6)
    c = (7, 8, 9)
    result = nested.zip(a, b, c)
    self.assertEqual(((1, 4, 7), (2, 5, 8), (3, 6, 9)), result)

  def test_shallow_dict(self):
    a = {'a': 1, 'b': 2, 'c': 3}
    b = {'a': 4, 'b': 5, 'c': 6}
    c = {'a': 7, 'b': 8, 'c': 9}
    result = nested.zip(a, b, c)
    self.assertEqual({'a': (1, 4, 7), 'b': (2, 5, 8), 'c': (3, 6, 9)}, result)

  def test_single(self):
    a = [[1, 2], 3]

    result = nested.zip(a)