docstr: Install a stub version of TensorBoard.
  
  Args:
    name: A short description of the stub's behavior. This will appear
      in the file path, which may appear in error messages.
    program: The contents of the stub: this should probably be a
      string that starts with "#!/bin/sh" and then contains a POSIX
      shell script.
docstr_tok: ["Install","a","stub","version","of","TensorBoard",".","Args",":","name",":","A","short","description","of","the","stub","'s","behavior",".","This","will","appear","in","the","file","path",",","which","may","appear","in","error","messages",".","program",":","The","contents","of","the","stub",":","this","should","probably","be","a","string","that","starts","with","``","#","!","\/bin\/sh","''","and","then","contains","a","POSIX","shell","script","."]
code: def _stub_tensorboard(self, name, program):
      """Install a stub version of TensorBoard.
  
      Args:
        name: A short description of the stub's behavior. This will appear
          in the file path, which may appear in error messages.
        program: The contents of the stub: this should probably be a
          string that starts with "#!/bin/sh" and then contains a POSIX
          shell script.
      """
      tempdir = tempfile.mkdtemp(prefix="tensorboard-stub-%s-" % name)
      # (this directory is under our test directory; no need to clean it up)
      filepath = os.path.join(tempdir, "tensorboard")
      with open(filepath, "w") as outfile:
          outfile.write(program)
      os.chmod(filepath, 0o777)
      self._patch_environ(
          {
              "PATH": os.pathsep.join((tempdir, os.environ["PATH"])),
          }
      )
      self._ensure_tensorboard_on_path(expected_binary_dir=tempdir)
  
imports: import contextlib
  import datetime
  import errno
  import json
  import os
  import pipes
  import signal
  import shutil
  import subprocess
  import tempfile
  import textwrap
  from unittest import mock
  import urllib.request
  import tensorflow
  from tensorboard import manager
label_desc: Use image node_id 5 for calling the ManagerEndToEndTest obj's underlying member method code with example usage: obj._stub_tensorboard(name, program) without return types