class_docstr: Convert strings to dvi files using TeX, caching the results to a directory.
  
  The cache directory is called ``tex.cache`` and is located in the directory
  returned by `.get_cachedir`.
  
  Repeated calls to this constructor always return the same instance.
class_docstr_tok: ["Convert","strings","to","dvi","files","using","TeX",",","caching","the","results","to","a","directory",".","The","cache","directory","is","called","``","tex.cache","``","and","is","located","in","the","directory","returned","by","`",".get_cachedir","`",".","Repeated","calls","to","this","constructor","always","return","the","same","instance","."]
code: def _run_checked_subprocess(cls, command, tex, *, cwd=None):
      _log.debug(cbook._pformat_subprocess(command))
      try:
          report = subprocess.check_output(
              command,
              cwd=cwd if cwd is not None else cls._texcache,
              stderr=subprocess.STDOUT,
          )
      except FileNotFoundError as exc:
          raise RuntimeError(
              f"Failed to process string with tex because {command[0]} "
              "could not be found"
          ) from exc
      except subprocess.CalledProcessError as exc:
          raise RuntimeError(
              "{prog} was not able to process the following string:\n"
              "{tex!r}\n\n"
              "Here is the full command invocation and its output:\n\n"
              "{format_command}\n\n"
              "{exc}\n\n".format(
                  prog=command[0],
                  format_command=cbook._pformat_subprocess(command),
                  tex=tex.encode("unicode_escape"),
                  exc=exc.output.decode("utf-8", "backslashreplace"),
              )
          ) from None
      _log.debug(report)
      return report
  
imports: import functools
  import hashlib
  import logging
  import os
  from pathlib import Path
  import subprocess
  from tempfile import TemporaryDirectory
  import numpy
  import matplotlib
  from matplotlib import _api, cbook, dviread
label_desc: Use image node_id 9 for calling the TexManager obj's underlying member method code with example usage: obj._run_checked_subprocess(cls, command, tex) and returns: report