code: def ignore_warnings(
      to_ignore: List[Tuple[Type[Warning], str]] = ignored_warnings
  ) -> Iterator[None]:
      """A context manager to ignore warnings
  
      >>> with ignore_warnings(classifier_warnings):
      >>>     ...
  
      Parameters
      ----------
      to_ignore: List[Tuple[Exception, str]] = ignored_warnings
          The list of warnings to ignore, defaults to all registered warnings
      """
      with warnings.catch_warnings():
          for category, message in to_ignore:
              warnings.filterwarnings(
                  "ignore", category=category, message=message
              )
          yield
  
imports: from typing import Iterator, List, Tuple, Type
  import warnings
  from contextlib import contextmanager
  from sklearn.exceptions import ConvergenceWarning
label_desc: Use image node_id 1 for calling a global function with example usage: ignore_warnings(to_ignore) without return types