code: def test_try_import_not_successful() -> None:
      with try_import() as imports:
          raise ImportError
      assert not imports.is_successful()
      with pytest.raises(ImportError):
          imports.check()
  
      with try_import() as imports:
          raise SyntaxError
      assert not imports.is_successful()
      with pytest.raises(ImportError):
          imports.check()
  
imports: import pytest
  from optuna._imports import try_import
label_desc: Use image node_id 3 for calling a global function with example usage: test_try_import_not_successful() without return types