code: def _ignore_deprecated_imports(ignore=True):
      """Context manager to suppress package and module deprecation
      warnings when importing them.
  
      If ignore is False, this context manager has no effect.
      """
      if ignore:
          with warnings.catch_warnings():
              warnings.filterwarnings(
                  "ignore", ".+ (module|package)", DeprecationWarning
              )
              yield
      else:
          yield
  
imports: import contextlib
  import _imp
  import importlib
  import importlib.util
  import os
  import shutil
  import sys
  import unittest
  import warnings
  from .os_helper import unlink, temp_dir
label_desc: Use image node_id 1 for calling a global function with example usage: _ignore_deprecated_imports(ignore) without return types