Return True if this frame should be traced, False if tracing should be blocked.
965710
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)
390834
def enable_tracing(self):
        
        _logger.x_debug("entering enable_tracing()")
        # uncomment next line to get debugger tracing info
        #self.dump_tracing_state("before enable_tracing()")
        
        if not self.tracing_enabled and self.execution_started:
            # Restore or set trace function on all existing frames appart from 
            # debugger
            threading.settrace(self._tracer)  # then enable on all threads to come
            for thr in threading.enumerate():
                if thr.ident != self.debugger_thread_ident:  # skip debugger thread
                    a_frame = sys._current_frames()[thr.ident]
                    while a_frame:
                        a_frame.f_trace = self._tracer
                        a_frame = a_frame.f_back
            iksettrace3._set_trace_on(self._tracer, self.debugger_thread_ident)
            self.tracing_enabled = True
        
        #self.dump_tracing_state("after enable_tracing()")
        return self.tracing_enabled
1103055
def should_sample(self):
        
        return self.span_context.trace_options.enabled \
            or self.sampler.should_sample(self.span_context.trace_id)
1122114
def check(self, cfg, state, peek_blocks):
        

        # Get the current CFGNode from the CFG
        node = self._get_cfg_node(cfg, state)

        if node is None:
            # Umm it doesn't exist on the control flow graph - why?
            l.error('Failed to find CFGNode for state %s on the control flow graph.', state)
            return False

        # crawl the graph to see if we can reach the target address next
        for src, dst in self._dfs_edges(cfg.graph, node, max_steps=peek_blocks):
            if src.addr == self.addr or dst.addr == self.addr:
                l.debug("State %s will reach %#x.", state, self.addr)
                return True

        l.debug('SimState %s will not reach %#x.', state, self.addr)
        return False
281131
function tasync_trace_end(args, index) {
        Future.call(this);

        this.caller = FRAME;
        this.position = ++FRAME.subframes;
        this.subframes = 0;

        if (TASYNC_TRACE_ENABLE) {
            this.trace = new Error();
        }

        this.args = args;
        this.index = index;
    }
221636
boolean isMarked()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "isMarked");
      SibTr.exit(tc, "isMarked", new Boolean(_marked));
    }

    return _marked;
  }
590479
def _methodInTraceback(self, name, traceback):
    '''
    
    '''
    foundMethod = False
    for frame in self._frames(traceback):
      this = frame.f_locals.get('self')
      if this is self and frame.f_code.co_name == name:
        foundMethod = True
        break
    return foundMethod
439297
def _frames(traceback):
    '''
    
    '''
    frame = traceback
    while frame.tb_next:
      frame = frame.tb_next
      yield frame.tb_frame
    return
1053991
def dont_stalk_buffer(self, bw, *argv, **argd):
        
        self.dont_watch_buffer(bw, *argv, **argd)
1104583
private boolean isDebugOnFor(Frame frame)
    {
        if (_debugOn)
        {
            if (_debugPatterns==null)
                return true;
            else
            {
                for (int i = _debugPatterns.size();--i>=0;)
                {
                    if(frame.getWhere().indexOf((String)_debugPatterns
                                                .get(i))>=0)
                        return true;
                }
            }
        }
        return false;
    }
993897
protected function isVisitorIpExcluded()
    {
        $excludedIps = $this->getAttributes('excluded_ips', 'global_excluded_ips');

        if (!empty($excludedIps)) {
            $ip = IP::fromBinaryIP($this->ip);
            if ($ip->isInRanges($excludedIps)) {
                Common::printDebug('Visitor IP ' . $ip->toString() . ' is excluded from being tracked');
                return true;
            }
        }

        return false;
    }
368389
def is_not_blocked(self, item: str) -> bool:
        
        assert item is not None
        item = self._encode_item(item)
        connection = self.__get_connection()
        key = self.__redis_conf['blacklist_template'].format(item)
        value = connection.get(key)
        if value is None:
            BlackRed.__release_connection(connection)
            return True
        if self.__redis_conf['blacklist_refresh_ttl']:
            connection.expire(key, self.__redis_conf['blacklist_ttl'])
        BlackRed.__release_connection(connection)
        return False
431520
def disable_tracing(self):
        
        _logger.x_debug("disable_tracing()")
        #self.dump_tracing_state("before disable_tracing()")
        if self.tracing_enabled and self.execution_started:
            threading.settrace(None)  # don't trace threads to come
            iksettrace3._set_trace_off()
            self.tracing_enabled = False
        #self.dump_tracing_state("after disable_tracing()")
        return self.tracing_enabled
1261856
protected void trace( int x , int y , int indexInten ) {

		int dx,dy;

		int indexOut = output.getIndex(x,y);
		open.grow().set(x,y);
		output.data[indexOut] = 1;
		intensity.data[ indexInten ] = MARK_TRAVERSED;

		while( open.size() > 0 ) {
			active.set(open.removeTail());
			indexInten = intensity.getIndex(active.x,active.y);
			int indexDir = direction.getIndex(active.x,active.y);

			boolean first = true;

			while( true ) {
				//----- First check along the direction of the edge.  Only need to check 2 points this way
				switch( direction.data[ indexDir ] ) {
					case  0: dx =  0;dy=  1; break;
					case  1: dx =  1;dy= -1; break;
					case  2: dx =  1;dy=  0; break;
					case -1: dx =  1;dy=  1; break;
					default: throw new RuntimeException("Unknown direction: "+direction.data[ indexDir ]);
				}

				int indexForward = indexInten + dy*intensity.stride + dx;
				int indexBackward = indexInten - dy*intensity.stride - dx;

				int prevIndexDir = indexDir;

				boolean match = false;

				// pixel coordinate of forward and backward point
				x = active.x; y = active.y;
				int fx = active.x+dx, fy = active.y+dy;
				int bx = active.x-dx, by = active.y-dy;

				if( intensity.isInBounds(fx,fy) && intensity.data[ indexForward ] >= lower ) {
					intensity.data[ indexForward ] = MARK_TRAVERSED;
					output.unsafe_set(fx, fy, 1);
					active.set(fx, fy);
					match = true;
					indexInten = indexForward;
					indexDir = prevIndexDir  + dy*intensity.stride + dx;
				}
				if( intensity.isInBounds(bx,by) && intensity.data[ indexBackward ] >= lower ) {
					intensity.data[ indexBackward ] = MARK_TRAVERSED;
					output.unsafe_set(bx,by,1);
					if( match ) {
						open.grow().set(bx,by);
					} else {
						active.set(bx,by);
						match = true;
						indexInten = indexBackward;
						indexDir = prevIndexDir  - dy*intensity.stride - dx;
					}
				}

				if( first || !match ) {
					boolean priorMatch = match;
					// Check local neighbors if its one of the end points, which would be the first point or
					// any point for which no matches were found
					match = checkAllNeighbors(x,y,match);

					if( !match )
						break;
					else {
						// if it was the first it's no longer the first
						first = false;

						// the point at the end was just added and is to be searched in the next iteration
						if( !priorMatch ) {
							indexInten = intensity.getIndex(active.x, active.y);
							indexDir = direction.getIndex(active.x,active.y);
						}
					}
				}
			}
		}
	}
239668
synchronized public boolean isBlacklisted(String trackerID) {
    TaskTrackerStatus status = getTaskTrackerStatus(trackerID);
    if (status != null) {
      return faultyTrackers.isBlacklisted(status.getHost());
    }
    return false;
  }
1334353
def tcp_traceflow(frame, *, data_link):
    """"""
    if 'TCP' in frame:
        ip = (frame['IPv4'] if 'IPv4' in frame else frame['IPv6']).info
        tcp = frame['TCP'].info
        data = dict(
            protocol=data_link,                     # data link type from global header
            index=frame.info.number,                # frame number
            frame=frame.info,                       # extracted frame info
            syn=tcp.flags.syn,                      # TCP synchronise (SYN) flag
            fin=tcp.flags.fin,                      # TCP finish (FIN) flag
            src=ip.src,                             # source IP
            dst=ip.dst,                             # destination IP
            srcport=tcp.srcport,                    # TCP source port
            dstport=tcp.dstport,                    # TCP destination port
            timestamp=frame.info.time_epoch,        # frame timestamp
        )
        return True, data
    return False, None
769386
public boolean process(Trace trace, Node node, Direction direction,
            Map<String, ?> headers, Object[] values) {

        if (predicate != null) {
            return predicate.test(trace, node, direction, headers, values);
        }

        return true;
    }