code: def test_init(self):
      # Init from dict
      d = {"foo": {"a": 1}, "bar": 2}
      f = FlatMap(d)
      self.assertEqual(f, d)
  
      # Init from FlatMap
      f2 = FlatMap(f)
      self.assertEqual(f, f2)
  
      # Init from dict with nested FlatMap
      inner = FlatMap({"a": 1})
      outer = {"foo": inner, "bar": 2}
      nested_flatmapping = FlatMap(outer)
      self.assertEqual(outer, nested_flatmapping)
  
      # Init from flat structures
      values, treedef = jax.tree_util.tree_flatten(f)
      self.assertEqual(
          FlatMap(data_structures.FlatComponents(values, treedef)), f
      )
  
imports: import collections
  import copy
  import pickle
  import threading
  from absl.testing import absltest
  from absl.testing import parameterized
  import cloudpickle
  import dill
  from haiku._src import data_structures
  import jax
  import tree
label_desc: Use image node_id 21 for calling the FlatMappingTest obj's underlying member method code with example usage: obj.test_init() without return types