code: def _check_pydot_and_graphviz():
      """Check if pydot and graphviz are installed.
  
      pydot and graphviz are required for plotting. We check this
      during runtime rather than adding them to Ray dependencies.
  
      """
      try:
          import pydot
      except ImportError:
          raise ImportError(
              "pydot is required to plot DAG, "
              "install it with `pip install pydot`."
          )
      try:
          pydot.Dot.create(pydot.Dot())
      except (OSError, pydot.InvocationException):
          raise ImportError(
              "graphviz is required to plot DAG, "
              "download it from https://graphviz.gitlab.io/download/"
          )
  
file_path: ray/python/ray/dag/vis_utils.py
imports: from ray.dag import DAGNode
  import os
  import tempfile
  from ray.dag.utils import _DAGNodeNameGenerator
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 2 for calling a global function with example usage: _check_pydot_and_graphviz() without return types