Did I find the right examples for you? yes no

All Samples(184)  |  Call(167)  |  Derive(0)  |  Import(17)
Get information about a frame or traceback object.

A tuple of five things is returned: the filename, the line number of
the current line, the function name, a list of lines of context from
the source code, and the index of the current line within that list.
The optional second argument specifies the number of lines of context
to return, which are centered around the current line.

        def getframeinfo(frame, context=1):
    """Get information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line."""
    if istraceback(frame):
        lineno = frame.tb_lineno
        frame = frame.tb_frame
    else:
        lineno = frame.f_lineno
    if not isframe(frame):
        raise TypeError('{!r} is not a frame or traceback object'.format(frame))

    filename = getsourcefile(frame) or getfile(frame)
    if context > 0:
        start = lineno - 1 - context//2
        try:
            lines, lnum = findsource(frame)
        except IOError:
            lines = index = None
        else:
            start = max(start, 1)
            start = max(0, min(start, len(lines) - context))
            lines = lines[start:start+context]
            index = lineno - 1 - start
    else:
        lines = index = None

    return Traceback(filename, lineno, frame.f_code.co_name, lines, index)
        


src/f/i/FiPy-3.1/fipy/tools/inline.py   FiPy(Download)
        frame = frame.f_back
 
    return (frame,) + inspect.getframeinfo(frame, context=context)
 
def _rawCodeComment(code, level=2):

src/p/i/pikos-HEAD/pikos/monitors/line_monitor.py   pikos(Download)
        if why == 'line':
            filename, lineno, function, line, _ = \
                inspect.getframeinfo(frame, context=1)
            if line is None:
                line = ['<compiled string>']
        if why == 'line':
            filename, lineno, function, line, _ = \
                inspect.getframeinfo(frame, context=1)
            if line is None:
                line = ['<compiled string>']

src/p/i/pikos-HEAD/pikos/monitors/line_memory_monitor.py   pikos(Download)
            usage = self._process.get_memory_info()
            filename, lineno, function, line, _ = \
                inspect.getframeinfo(frame, context=1)
            if line is None:
                line = ['<compiled string>']
            usage = self._process.get_memory_info()
            filename, lineno, function, line, _ = \
                inspect.getframeinfo(frame, context=1)
            if line is None:
                line = ['<compiled string>']

src/p/i/pikos-HEAD/pikos/monitors/function_memory_monitor.py   pikos(Download)
        usage = self._process.get_memory_info()
        filename, lineno, function, _, _ = \
            inspect.getframeinfo(frame, context=0)
        if event.startswith('c_'):
            function = arg.__name__
        usage = self._process.get_memory_info()
        filename, lineno, function, _, _ = \
            inspect.getframeinfo(frame, context=0)
        if event.startswith('c_'):
            function = arg.__name__

src/l/g/lggr-0.2.0/lggr/__init__.py   lggr(Download)
                continue
            sinfo = traceback.extract_stack(f)
            fname, lno, fnc, cc, i = inspect.getframeinfo(f, context=10)
 
            # Mark the calling line with a >

src/l/g/lggr-HEAD/lggr/__init__.py   lggr(Download)
                continue
            sinfo = traceback.extract_stack(f)
            fname, lno, fnc, cc, i = inspect.getframeinfo(f, context=10)
 
            # Mark the calling line with a >

src/p/i/pikos-HEAD/pikos/benchmark/function_events.py   pikos(Download)
    def original_method(self, frame, event, arg):
        """ The original method for the function event monitor.
        """
        filename, lineno, function, _, _ = \
            inspect.getframeinfo(frame, context=0)

src/s/a/sage-HEAD/src/sage/misc/profiler.py   sage(Download)
        frame = inspect.currentframe().f_back
        try:
            frame_info = inspect.getframeinfo(frame, 9)
            line_number = frame_info[1]
            context = frame_info[3]

src/r/e/reahl-tofu-2.1.0/reahl/tofu/checks.py   reahl-tofu(Download)
                calling_frame = calling_context[0]
 
                [source] = inspect.getframeinfo(calling_frame, 1)[3]
                names = self.find_names(source)
 

src/c/o/commuter-HEAD/simsym.py   commuter(Download)
 
        # Unwind out of this module and record the call stack
        frames = [inspect.getframeinfo(frrec[0], 3)
                  for frrec in inspect.stack()]
        for i, frame in enumerate(frames):

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