class_docstr: Tests for access APIs for packaged resources.
code: def test_importer_access(self):
      buffer = BytesIO()
      with PackageExporter(buffer) as he:
          he.save_text("main", "main", "my string")
          he.save_binary("main", "main_binary", b"my string")
          src = dedent(
              """\
                  import importlib
                  import torch_package_importer as resources
  
                  t = resources.load_text('main', 'main')
                  b = resources.load_binary('main', 'main_binary')
                  """
          )
          he.save_source_string("main", src, is_package=True)
      buffer.seek(0)
      hi = PackageImporter(buffer)
      m = hi.import_module("main")
      self.assertEqual(m.t, "my string")
      self.assertEqual(m.b, b"my string")
  
file_path: pytorch/test/package/test_resources.py
imports: from io import BytesIO
  from sys import version_info
  from textwrap import dedent
  from unittest import skipIf
  from torch.package import PackageExporter, PackageImporter
  from torch.testing._internal.common_utils import run_tests
label_desc: Use image node_id 3 for calling the TestResources obj's underlying member method code with example usage: obj.test_importer_access() without return types