class_docstr: Tests for `write_info_file`, `remove_info_file`, and `get_all`.
class_docstr_tok: ["Tests","for","`","write_info_file","`",",","`","remove_info_file","`",",","and","`","get_all","`","."]
code: def test_writing_file_with_restrictive_umask(self):
      if os.name == "nt":
          self.skipTest("Windows does not use POSIX-style permissions.")
      os.rmdir(self.info_dir)
      # Even if umask prevents owner-access, our I/O should still work.
      old_umask = os.umask(0o777)
      try:
          # Sanity-check that, without special accommodation, this would
          # create inaccessible directories...
          sanity_dir = os.path.join(self.get_temp_dir(), "canary")
          os.mkdir(sanity_dir)
          self.assertMode(sanity_dir, 0o000)
  
          manager.write_info_file(_make_info())
          self.assertMode(self.info_dir, 0o777)
          self.assertEqual(self._list_info_dir(), ["pid-76540.info"])
      finally:
          self.assertEqual(oct(os.umask(old_umask)), oct(0o777))
  
imports: import dataclasses
  import datetime
  import errno
  import json
  import os
  import re
  import tempfile
  from unittest import mock
  from tensorboard import manager
  from tensorboard import test
  from tensorboard import version
  from tensorboard.util import tb_logging
label_desc: Use image node_id 6 for calling the TensorBoardInfoIoTest obj's underlying member method code with example usage: obj.test_writing_file_with_restrictive_umask() without return types