Coverage for /home/tbone/.local/share/hatch/env/virtual/importnb-aVRh-lqt/testpypi.stdlib/lib/python3.9/site-packages/importnb/__init__.py: 86%

21 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-10-03 13:35 -0700

1# coding: utf-8 

2 

3__all__ = "Notebook", "reload" 

4 

5def is_ipython(): 

6 from sys import modules 

7 

8 return "IPython" in modules 

9 

10def get_ipython(force=True): 

11 if force or is_ipython(): 

12 try: 

13 from IPython import get_ipython 

14 except ModuleNotFoundError: 

15 return 

16 shell = get_ipython() 

17 if shell is None: 

18 from IPython import InteractiveShell 

19 shell = InteractiveShell.instance() 

20 return shell 

21 return None 

22 

23from ._version import * 

24from .ipython_extension import load_ipython_extension, unload_ipython_extension 

25from .loader import Notebook, reload 

26 

27import builtins 

28builtins.true, builtins.false, builtins.null = True, False, None 

29 

30