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

1# coding: utf-8

2

3 __all__ = "Notebook", "reload", "imports" 6 ctx 1aebcfd

4

5

6 def is_ipython(): 6 ctx 1aebcfd

7 from sys import modules

8

9 return "IPython" in modules

10

11

12 def get_ipython(force=True): 6 ctx 1aebcfd

13 if force or is_ipython(): 13 ↛ 24line 13 didn't jump to line 24, because the condition on line 13 was never false 18 ctx 1gabchdijklmnopqrst

14 try: 18 ctx 1gabchdijklmnopqrst

15 from IPython import get_ipython 18 ctx 1gabchdijklmnopqrst

16 except ModuleNotFoundError:

17 return

18 shell = get_ipython() 18 ctx 1gabchdijklmnopqrst

19 if shell is None: 18 ctx 1gabchdijklmnopqrst

20 from IPython import InteractiveShell 4 ctx 1gabc

21

22 shell = InteractiveShell.instance() 4 ctx 1gabc

23 return shell 18 ctx 1gabchdijklmnopqrst

24 return None

25

26

27 import builtins 6 ctx 1aebcfd

28

29 from ._version import __version__ 6 ctx 1aebcfd

30 from .loader import Notebook, reload 6 ctx 1aebcfd

31 from .entry_points import imports 6 ctx 1aebcfd

32

33 builtins.true, builtins.false, builtins.null = True, False, None 6 ctx 1aebcfd