Coverage for /home/runner/.local/share/hatch/env/virtual/importnb/KA2AwMZG/test.stdlib/lib/python3.9/site-packages/importnb/__init__.py: 56%

21 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-11-02 04:02 +0000

1# coding: utf-8 

2 

3__all__ = "Notebook", "reload", "imports" 1adbce

4 

5 

6def is_ipython(): 1adbce

7 from sys import modules 

8 

9 return "IPython" in modules 

10 

11 

12def get_ipython(force=True): 1adbce

13 if force or is_ipython(): 13 ↛ 24line 13 didn't jump to line 24, because the condition on line 13 was never false1fabcghijklmnopqr

14 try: 1fabcghijklmnopqr

15 from IPython import get_ipython 1fabcghijklmnopqr

16 except ModuleNotFoundError: 1fabcghijklmnopqr

17 return 1fabcghijklmnopqr

18 shell = get_ipython() 

19 if shell is None: 

20 from IPython import InteractiveShell 

21 

22 shell = InteractiveShell.instance() 

23 return shell 

24 return None 

25 

26 

27import builtins 1adbce

28 

29from ._version import __version__ 1adbce

30from .loader import Notebook, reload 1adbce

31from .entry_points import imports 1adbce

32 

33builtins.true, builtins.false, builtins.null = True, False, None 1adbce