class_docstr: Context manager to defer exceptions from imports.
  
  Catches :exc:`ImportError` and :exc:`SyntaxError`.
  If any exception is caught, this class raises an :exc:`ImportError` when being checked.
class_docstr_tok: ["Context","manager","to","defer","exceptions","from","imports",".","Catches",":","exc",":","`","ImportError","`","and",":","exc",":","`","SyntaxError","`",".","If","any","exception","is","caught",",","this","class","raises","an",":","exc",":","`","ImportError","`","when","being","checked","."]
docstr: Check whether the context manager has caught any exceptions.
  
  Raises:
      :exc:`ImportError`:
          If any exception was caught from the caught exception.
docstr_tok: ["Check","whether","the","context","manager","has","caught","any","exceptions",".","Raises",":",":","exc",":","`","ImportError","`",":","If","any","exception","was","caught","from","the","caught","exception","."]
code: def check(self) -> None:
      """Check whether the context manager has caught any exceptions.
  
      Raises:
          :exc:`ImportError`:
              If any exception was caught from the caught exception.
  
      """
      if self._deferred is not None:
          exc_value, message = self._deferred
          raise ImportError(message) from exc_value
  
file_path: optuna/optuna/_imports.py
imports: import importlib
  import types
  from types import TracebackType
  from typing import Any
  from typing import Optional
  from typing import Tuple
  from typing import Type
label_desc: Use image node_id 5 for calling the _DeferredImportExceptionContextManager obj's underlying member method code with example usage: obj.check() without return types