code: def test_get_public_api(self):
      tmp_dir = self.create_tempdir()
      write_test_data(tmp_dir.full_path)
  
      expected_tensor_top_level = generator._Entrypoint(
          module="tf",
          name="Tensor",
          exported_symbol=tensor_es,
      )
  
      expected = generator.PublicAPI(
          v1_entrypoints_by_module=collections.defaultdict(set),
          v2_entrypoints_by_module=collections.defaultdict(set),
          v1_generated_imports_by_module=collections.defaultdict(set),
          v2_generated_imports_by_module=collections.defaultdict(set),
          docs_by_module={},
      )
      expected.v1_entrypoints_by_module["tf"].add(
          expected_tensor_top_level
      )
      expected.v2_entrypoints_by_module["tf"].add(
          expected_tensor_top_level
      )
      expected.v2_entrypoints_by_module["tf.experimental.numpy"].add(
          generator._Entrypoint(
              module="tf.experimental.numpy",
              name="ndarray",
              exported_symbol=tensor_es,
          )
      )
      expected.v2_generated_imports_by_module["tf"].add(
          "tf.experimental"
      )
      expected.v2_generated_imports_by_module["tf.experimental"].add(
          "tf.experimental.numpy"
      )
  
      got = generator.get_public_api(
          [os.path.join(tmp_dir, f) for f in test_data],
          file_prefixes_to_strip=[tmp_dir.full_path],
          packages_to_ignore=["tf.python.framework.test_ops"],
          output_package="tf",
          module_prefix="",
      )
  
      self.assertEqual(
          expected,
          got,
      )
  
file_path: tensorflow/tensorflow/python/tools/api/generator2/generator/generator_test.py
imports: import collections
  import os
  from absl.testing import absltest
  from absl.testing import parameterized
  from tensorflow.python.tools.api.generator2.generator import generator
  from tensorflow.python.tools.api.generator2.shared import exported_api
label_desc: Use image node_id 1 for calling the GeneratorTest obj's underlying member method code with example usage: obj.test_get_public_api() without return types