code: def __init__(self, *, prefix: str = "tmp", suffix: str = "") -> None:
      # XXX: selenium has issues with /tmp directory (or equivalent), so try using the
      # current directory first, if writable, and otherwise fall back to the system
      # default tmp directory.
      try:
          self.fd, self.path = mkstemp(
              prefix=prefix, suffix=suffix, dir=os.getcwd()
          )
      except OSError:
          self.fd, self.path = mkstemp(prefix=prefix, suffix=suffix)
  
imports: from __future__ import annotations
  import logging
  import io
  import os
  from contextlib import contextmanager
  from os.path import abspath, expanduser, splitext
  from tempfile import mkstemp
  from typing import TYPE_CHECKING, Any, Iterator, cast
  from ..core.types import PathLike
  from ..document import Document
  from ..embed import file_html
  from ..resources import INLINE, Resources
  from ..themes import Theme
  from ..util.warnings import warn
  from .state import State, curstate
  from .util import default_filename
label_desc: Use image node_id 1 to create a new _TempFile object  with example: obj = _TempFile()