code: def skip_if_missing(tool=None):
      if tool:
          tooldir = os.path.join(toolsdir, tool)
      else:
          tool = "scripts"
          tooldir = scriptsdir
      if not os.path.isdir(tooldir):
          raise unittest.SkipTest(
              f"{tool} directory could not be found"
          )
  
file_path: cpython/Lib/test/test_tools/__init__.py
imports: import contextlib
  import importlib
  import os.path
  import unittest
  from test import support
  from test.support import import_helper
label_desc: Use image node_id 1 for calling a global function with example usage: skip_if_missing(tool) without return types