• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(395)  |  Call(378)  |  Derive(0)  |  Import(17)
Return a list of records for the stack above the caller's frame.

        def stack(context=1):
    """Return a list of records for the stack above the caller's frame."""
    return getouterframes(sys._getframe(1), context)
        


src/a/n/antlr3-python-example-HEAD/antlr3/recognizers.py   antlr3-python-example(Download)
        # requested recognizer...
 
        rules = []
        for frame in reversed(inspect.stack()):
            code = frame[0].f_code
            codeMod = inspect.getmodule(code)
            if codeMod is None:

src/t/a/taskcoach-HEAD/trunk/taskcoach/taskcoachlib/meta/debug.py   taskcoach(Download)
        def inner(*args, **kwargs):
            result = func(*args, **kwargs)
            write = sys.stdout.write
            for frame in inspect.stack(context=2)[traceback_depth:0:-1]:
                write(format_traceback(frame))
            write('%s\n'%signature(func, args, kwargs, result))
            write('===\n')

src/t/a/taskcoach-HEAD/taskcoach/taskcoachlib/meta/debug.py   taskcoach(Download)
        def inner(*args, **kwargs):
            result = func(*args, **kwargs)
            write = sys.stdout.write
            for frame in inspect.stack(context=2)[traceback_depth:0:-1]:
                write(format_traceback(frame))
            write('%s\n'%signature(func, args, kwargs, result))
            write('===\n')

src/t/o/topographica-HEAD/releases/0.9.7/topographica/topo/misc/asizeof.py   topographica(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
    def _getobjects():
         # modules first, globals and stack
         # (may contain duplicate objects)
        return tuple(_values(sys.modules)) + (
               globals(), stack(sys.getrecursionlimit()))
 
try:  # get 'all' referents of objects
 
    if _opts('-stack'):  # stack examples
        _printf('%sasizeof(%s, limit=%s, code=%s) ... %s', linesep, 'stack(MAX)', 'MAX', False, '')
        asizeof(stack(MAX), limit=MAX, code=False, stats=1)
        _print_functions(stack(MAX), 'stack(MAX)', opt='-stack')
 
    if _opts('-sys'):  # sys.modules examples

src/t/o/topographica-HEAD/topographica/topo/misc/asizeof.py   topographica(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
    def _getobjects():
         # modules first, globals and stack
         # (may contain duplicate objects)
        return tuple(_values(sys.modules)) + (
               globals(), stack(sys.getrecursionlimit()))
 
try:  # get 'all' referents of objects
 
    if _opts('-stack'):  # stack examples
        _printf('%sasizeof(%s, limit=%s, code=%s) ... %s', linesep, 'stack(MAX)', 'MAX', False, '')
        asizeof(stack(MAX), limit=MAX, code=False, stats=1)
        _print_functions(stack(MAX), 'stack(MAX)', opt='-stack')
 
    if _opts('-sys'):  # sys.modules examples

src/p/y/Pympler-0.1/pympler/asizeof/asizeof.py   Pympler(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
         # ... modules first, globals and stack
         # (may contain duplicate objects)
        t = tuple(_values(sys.modules)) + (
            globals(), stack(sys.getrecursionlimit()))
    else:
        raise ValueError('invalid option: %s=%r' % ('all', all))
    return t, opts  #PYCHOK OK
 
    if _opts('-stack'):  # stack examples
        _printf('%sasizeof(%s, limit=%s, code=%s) ... %s', linesep, 'stack(MAX)', 'MAX', False, '')
        asizeof(stack(MAX), limit=MAX, code=False, stats=1)
        _print_functions(stack(MAX), 'stack(MAX)', opt='-stack')
 
    if _opts('-sys'):  # sys.modules examples

src/t/o/topographica-0.9.7/topo/misc/asizeof.py   topographica(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
    def _getobjects():
         # modules first, globals and stack
         # (may contain duplicate objects)
        return tuple(_values(sys.modules)) + (
               globals(), stack(sys.getrecursionlimit()))
 
try:  # get 'all' referents of objects
 
    if _opts('-stack'):  # stack examples
        _printf('%sasizeof(%s, limit=%s, code=%s) ... %s', linesep, 'stack(MAX)', 'MAX', False, '')
        asizeof(stack(MAX), limit=MAX, code=False, stats=1)
        _print_functions(stack(MAX), 'stack(MAX)', opt='-stack')
 
    if _opts('-sys'):  # sys.modules examples

src/e/n/EnthoughtBase-3.0.5/enthought/util/api.py   EnthoughtBase(Download)
def called_from(levels=1, context=1):
    """ Prints the caller's stack info """
    print '***** Deprecated.  Please use enthought.debug.called_from'
    from inspect import stack
    stk = stack(context)
    frame, file_name, line_num, func_name, lines, index = stk[1]
    print "'%s' called from:" % func_name

src/w/s/wsnpy-HEAD/y1/ne1.py   wsnpy(Download)
    current line within that list.
 
    """
    frame_record = inspect.stack(0)[2]
    variables = frame_record[0].f_locals
    return "{0}_{1:02d}_{2:06d}".format(frame_record[3], 
                                            variables['tst_nr'],
                                            variables['repetitions'])
def save_npz(*args):
    frame_record = inspect.stack(0)[1]

src/w/s/wsnpy-HEAD/net.py   wsnpy(Download)
    current line within that list.
 
    """
    frame_record = inspect.stack(0)[2]
    variables = frame_record[0].f_locals
    return "{0}_{1:02d}_{2:06d}".format(frame_record[3], 
                                            variables['tst_nr'],
                                            variables['repetitions'])
def save_npz(*args):
    frame_record = inspect.stack(0)[1]

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next