(frame, filename)
return not (
        func_line - 1 in ignored_lines or #-1 to get line before method 
        func_line in ignored_lines)
Return True if this frame should be traced, False if tracing should be blocked.
Return True if this frame should be traced, False if tracing should be blocked.
Return True if this frame should be traced False if tracing should be blocked .
def default_should_trace_hook(frame, filename):
    '''
    Return True if this frame should be traced, False if tracing should be blocked.
    '''
    # First, check whether this code object has a cached value
    ignored_lines = _filename_to_ignored_lines.get(filename)
    if ignored_lines is None:
        # Now, look up that line of code and check for a @DontTrace
        # preceding or on the same line as the method.
        # E.g.:
        # #@DontTrace
        # def test():
        #     pass
        #  ... or ...
        # def test(): #@DontTrace
        #     pass
        ignored_lines = {}
        lines = linecache.getlines(filename)
        for i_line, line in enumerate(lines):
            j = line.find('#')
            if j >= 0:
                comment = line[j:]
                if DONT_TRACE_TAG in comment:
                    ignored_lines[i_line] = 1
                    
                    #Note: when it's found in the comment, mark it up and down for the decorator lines found.
                    k = i_line - 1
                    while k >= 0:
                        if RE_DECORATOR.match(lines[k]):
                            ignored_lines[k] = 1
                            k -= 1
                        else:
                            break
                        
                    k = i_line + 1
                    while k <= len(lines):
                        if RE_DECORATOR.match(lines[k]):
                            ignored_lines[k] = 1
                            k += 1
                        else:
                            break
                        

        _filename_to_ignored_lines[filename] = ignored_lines

    func_line = frame.f_code.co_firstlineno - 1 # co_firstlineno is 1-based, so -1 is needed
    return not (
        func_line - 1 in ignored_lines or #-1 to get line before method 
        func_line in ignored_lines)
def default_should_trace_hook ( frame , filename ) : # First, check whether this code object has a cached value ignored_lines = _filename_to_ignored_lines . get ( filename ) if ignored_lines is None : # Now, look up that line of code and check for a @DontTrace # preceding or on the same line as the method. # E.g.: # #@DontTrace # def test(): #     pass #  ... or ... # def test(): #@DontTrace #     pass ignored_lines = { } lines = linecache . getlines ( filename ) for i_line , line in enumerate ( lines ) : j = line . find ( '#' ) if j >= 0 : comment = line [ j : ] if DONT_TRACE_TAG in comment : ignored_lines [ i_line ] = 1 #Note: when it's found in the comment, mark it up and down for the decorator lines found. k = i_line - 1 while k >= 0 : if RE_DECORATOR . match ( lines [ k ] ) : ignored_lines [ k ] = 1 k -= 1 else : break k = i_line + 1 while k <= len ( lines ) : if RE_DECORATOR . match ( lines [ k ] ) : ignored_lines [ k ] = 1 k += 1 else : break _filename_to_ignored_lines [ filename ] = ignored_lines func_line = frame . f_code . co_firstlineno - 1 # co_firstlineno is 1-based, so -1 is needed return not ( func_line - 1 in ignored_lines or #-1 to get line before method  func_line in ignored_lines )