def MonkeyPatchPdb(pdb):

  def NewSetTrace():
    """Replacement for set_trace() that uses the original i/o streams.

    This is necessary because by the time the user code that might
    invoke pdb.set_trace() runs, the default sys.stdin and sys.stdout
    are redirected to the HTTP request and response streams instead,
    so that pdb will encounter garbage (or EOF) in its input, and its
    output will garble the HTTP response.  Fortunately, sys.__stdin__
    and sys.__stderr__ retain references to the original streams --
    this is a standard Python feature.  Also, fortunately, as of
    Python 2.5, the Pdb class lets you easily override stdin and
    stdout.  The original set_trace() function does essentially the
    same thing as the code here except it instantiates Pdb() without
    arguments.
    """
    p = pdb.Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__)
    p.set_trace(sys._getframe().f_back)

  pdb.set_trace = NewSetTrace
should return a list of NavigationNode instances
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/dev_appserver.py/MonkeyPatchPdb--crossover with--dataset/ETHPy150Open divio/django-cms/menus/base.py/Menu.get_nodes