File size: 598 Bytes
db5855f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# https://github.com/RobbeSneyders/Jupyter-skip-extension/blob/e77e3708ebb37a3ff0e851fd773adc851d7c1d6a/skip_kernel_extension.py


def skip(line, cell=None):
    """Skips execution of the current line/cell."""
    if eval(line):
        return

    get_ipython().ex(cell)


def load_ipython_extension(shell):
    """Registers the skip magic when the extension loads."""
    shell.register_magic_function(skip, "line_cell")


def unload_ipython_extension(shell):
    """Unregisters the skip magic when the extension unloads."""
    del shell.magics_manager.magics["cell"]["skip"]