<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 PDB
Use of ipdb within Jupyterlab
start pdb from within a script
Step1:  Tracer
Step2:  Interactive Python Console
When this line is hit a python console will be invoked
Step3:  Pixie Debugger
Doesn't work in Jupyterlab because of unsupported Javascript output.
<ASSISTANT_TASK:>
Python Code:
%pdb on
%pdb
def pick_and_take():
    picked = numpy.random.randint(0, 1000)
    raise NotImplementedError()
pick_and_take()
import pdb;pdb.set_trace()
def func(x):
  return x + 1
for i in range(100):
  print(func(i))
  if i == 10 or i == 20:
    import pdb;pdb.set_trace()
raise Exception
Explanation: PDB
Use of ipdb within Jupyterlab
start pdb from within a script:
python
import pdb;pdb.set_trace()
start pdb from the commandline:
python
python -m pdb&lt;file.py&gt;
PDB / iPDB Commands
| Command                | Description |
| ---------------------- | ----------- |
| h(elp)             | print available commands |
| h(elp) command | print help about command |
| q(uit)             | quit debugger |
| p(rint) expr   | print value of expr |
| pp expr            | pretty print expr |
| w(here)            | print current position (inlcuding stack trace |
| l(ist)             | list 11 lines of code around the current line |
| a(rgs)             | print args of the current function |
| n(ext)             | execute the current statement step over |
| s(tep)             | execute and step into function |
| r(eturn)           | continue execution until the current function returns |
| c(ontinue)         | continue execution  until a breakpoint is encountered |
| u(p)               | move one level up in stack trace |
| d(own)             | move one level down in stack trace |
| b(reak)            | show all breakpoints |
| b(reak) lineno | set a breakpoint at lineno |
| b(reak) func   | set a breakpoint at the first line of a func |
| !stmt                  | treat stmt as a Python statment instead of a pdb command |
| exit               | like exit debugger |
End of explanation
def test_debug(y):
    x = 10
    # One-liner to start the debugger here.
    from IPython.core.debugger import Tracer; Tracer()()
    x = x + y
 
    for i in range(10):
        x = x+i
 
    return x
 
test_debug(10)
Explanation: Tracer
End of explanation
from IPython import embed; embed()
Explanation: Interactive Python Console
When this line is hit a python console will be invoked
End of explanation
import pixiedust
%%pixie_debugger
import random
def find_max (values):
    max = 0
    for val in values:
        if val > max:
            max = val
    return max
find_max(random.sample(range(100), 10))
Explanation: Pixie Debugger
Doesn't work in Jupyterlab because of unsupported Javascript output.
End of explanation
<END_TASK>