Returns true iff the edge corresponds to a message which is constant (i.e. sent from a leaf
node).
498798
public static boolean isConstantMsg(int edge, FactorGraph fg) {
        BipartiteGraph<Var,Factor> bg = fg.getBipgraph();
        int numNbs = bg.isT1T2(edge) ? bg.numNbsT1(bg.parentE(edge)) : bg.numNbsT2(bg.parentE(edge)); 
        return numNbs == 1;
    }
574487
def _check_node_consistency(self):
        
        # Get list of nodes from the node attributes dict
        nodes_from_attributes = set(self._node_attributes.keys())

        # Get list of hyperedge_ids from the hyperedge attributes dict
        hyperedge_ids_from_attributes = set(self._hyperedge_attributes.keys())

        # Check 5.1: all nodes in the forward star must be in the
        # nodes from attributes
        forward_diff = set(self._forward_star.keys()) - nodes_from_attributes
        if forward_diff != set():
            raise ValueError(
                'Consistency Check 5.1 Failed: nodes %s ' % forward_diff +
                '(from forward star keys) is not in the node ' +
                'attribute dict.')

        # Check 5.2: all nodes in the backward star must be in the
        # nodes from attributes
        backward_diff = set(self._backward_star.keys()) - nodes_from_attributes
        if backward_diff != set():
            raise ValueError(
                'Consistency Check 5.2 Failed: node %s ' % backward_diff +
                '(from backward star keys) is not in the node ' +
                'attribute dict.')

        # Note that, by Check 5.1 and 5.2, self._forward_star.keys() =
        # self._backward_star.keys().

        # Check 5.3: all nodes in hyperedge_attributes dictionary must
        # be in the nodes from attributes.
        for hyperedge_id in hyperedge_ids_from_attributes:
            for tailnode in \
                    self._hyperedge_attributes[hyperedge_id]['tail']:
                if tailnode not in nodes_from_attributes:
                    raise ValueError(
                        'Consistency Check 5.3.1 Failed: tail ' +
                        'node %s of ' % tailnode +
                        'of hyperedge id %s ' % hyperedge_id +
                        'is not in node attribute dict')

            for headnode in self._hyperedge_attributes[hyperedge_id]['head']:
                if headnode not in nodes_from_attributes:
                    raise ValueError(
                        'Consistency Check 5.3.2 Failed: head ' +
                        'node %s of ' % headnode +
                        'of hyperedge id %s ' % hyperedge_id +
                        'is not in node attribute dict')

        # get set of nodes in predecessor dictionary.
        # adds both nodes in headset and nodes in tailset.
        nodes_in_predecessor_dict = set()
        for headset in self._predecessors.keys():
            nodes_in_predecessor_dict.update(headset)
            for tailset in self._predecessors[headset].keys():
                nodes_in_predecessor_dict.update(tailset)

        # get set of nodes in successor dictionary.
        # adds both nodes in headset and nodes in tailset.
        nodes_in_successor_dict = set()
        for headset in self._successors.keys():
            nodes_in_successor_dict.update(headset)
            for tailset in self._successors[headset].keys():
                nodes_in_successor_dict.update(tailset)

        # Check 5.4: the set of nodes in successor dict is the same as
        # the set of nodes in the predecessor dict
        if nodes_in_predecessor_dict != nodes_in_successor_dict:
            raise ValueError(
                'Consistency Check 5.4 Failed: nodes in ' +
                'successor dict are different than nodes ' +
                'in predecessor dict')

        # Check 5.5: all nodes in predecessor and successor dict must
        # be in the nodes from attributes (since 5.4 ensures they're the same)
        for node in nodes_in_predecessor_dict:
            if node not in nodes_from_attributes:
                raise ValueError(
                    'Consistency Check 5.5 Failed: node %s ' % node +
                    'from predecessor or successor dictionary ' +
                    'is not in node attribute dict')
1081850
private boolean isNotIncluded(Node x, Node y) {
        Node tmp;

        retry: while(true) {
        int yType = y.getType();

        switch(x.getType()) {
        case NodeType.CTYPE:
            switch(yType) {
            case NodeType.CTYPE:
            {
                CTypeNode cny = (CTypeNode)y;
                CTypeNode cnx = (CTypeNode)x;
                return cny.ctype == cnx.ctype && cny.not != cnx.not && cny.asciiRange == cnx.asciiRange;
            }
            case NodeType.CCLASS:
                // !swap:!
                tmp = x;
                x = y;
                y = tmp;
                // !goto retry;!
                continue retry;

            case NodeType.STR:
                // !goto swap;!
                tmp = x;
                x = y;
                y = tmp;
                continue retry;

            default:
                break;
            } // inner switch
            break;

        case NodeType.CCLASS:
            CClassNode xc = (CClassNode)x;

            switch(yType) {
            case NodeType.CTYPE:
            {
                CTypeNode yc = (CTypeNode)y;
                switch(yc.ctype) {
                case CharacterType.WORD:
                    if (!yc.not) {
                        if (xc.mbuf == null && !xc.isNot()) {
                            for (int i=0; i<BitSet.SINGLE_BYTE_SIZE; i++) {
                                if (xc.bs.at(i)) {
                                    if (yc.asciiRange) {
                                        if (enc.isSbWord(i)) return false;
                                    } else {
                                        if (enc.isWord(i)) return false;
                                    }
                                }
                            }
                            return true;
                        }
                        return false;
                    } else {
                        if (xc.mbuf != null) return false;
                        for (int i=0; i<BitSet.SINGLE_BYTE_SIZE; i++) {
                            boolean isWord;
                            if (yc.asciiRange) {
                                isWord = enc.isSbWord(i);
                            } else {
                                isWord = enc.isWord(i);
                            }

                            if (!isWord) {
                                if (!xc.isNot()) {
                                    if (xc.bs.at(i)) return false;
                                } else {
                                    if (!xc.bs.at(i)) return false;
                                }
                            }
                        }
                        return true;
                    }
                    // break; not reached
                default:
                    break;
                } // inner switch
                break;
            }

            case NodeType.CCLASS:
            {
                CClassNode yc = (CClassNode)y;

                for (int i=0; i<BitSet.SINGLE_BYTE_SIZE; i++) {
                    boolean v = xc.bs.at(i);
                    if ((v && !xc.isNot()) || (!v && xc.isNot())) {
                        v = yc.bs.at(i);
                        if ((v && !yc.isNot()) || (!v && yc.isNot())) return false;
                    }
                }
                if ((xc.mbuf == null && !xc.isNot()) || yc.mbuf == null && !yc.isNot()) return true;
                return false;
                // break; not reached
            }

            case NodeType.STR:
                // !goto swap;!
                tmp = x;
                x = y;
                y = tmp;
                continue retry;

            default:
                break;

            } // inner switch
            break; // case NodeType.CCLASS

        case NodeType.STR:
        {
            StringNode xs = (StringNode)x;
            if (xs.length() == 0) break;

            switch (yType) {
            case NodeType.CTYPE:
                CTypeNode cy = ((CTypeNode)y);
                switch (cy.ctype) {
                case CharacterType.WORD:
                    if (cy.asciiRange) {
                        if (Matcher.isMbcAsciiWord(enc, xs.bytes, xs.p, xs.end)) {
                            return cy.not;
                        } else {
                            return !cy.not;
                        }
                    } else {
                        if (enc.isMbcWord(xs.bytes, xs.p, xs.end)) {
                            return cy.not;
                        } else {
                            return !cy.not;
                        }
                    }

                default:
                    break;

                } // inner switch
                break;

            case NodeType.CCLASS:
                CClassNode cc = (CClassNode)y;
                int code = enc.mbcToCode(xs.bytes, xs.p, xs.p + enc.maxLength());
                return !cc.isCodeInCC(enc, code);

            case NodeType.STR:
                StringNode ys = (StringNode)y;
                int len = xs.length();
                if (len > ys.length()) len = ys.length();
                if (xs.isAmbig() || ys.isAmbig()) {
                    /* tiny version */
                    return false;
                } else {
                    for (int i=0, p=ys.p, q=xs.p; i<len; i++, p++, q++) {
                        if (ys.bytes[p] != xs.bytes[q]) return true;
                    }
                }
                break;

            default:
                break;
            } // inner switch

            break; // case NodeType.STR
        }
        } // switch

        break;
        } // retry: while
        return false;
    }
933802
def has_edge(self, node1_name, node2_name, account_for_direction=True):
        
        return self.__has_edge(node1_name=node1_name, node2_name=node2_name, account_for_direction=account_for_direction)
670054
public static Predicate<DirectedEdge> hasDestination(final Node node) {
        return input -> {
            assert input != null;
            return input.destination.equals(node);
        };
    }
440190
boolean isEdge( int x , int y ) {
		if( edgeThreshold <= 0 )
			return false;

		double xx = derivXX.compute(x,y);
		double xy = derivXY.compute(x,y);
		double yy = derivYY.compute(x,y);

		double Tr = xx + yy;
		double det = xx*yy - xy*xy;

		// Paper quite "In the unlikely event that the determinant is negative, the curvatures have different signs
		// so the point is discarded as not being an extremum"
		if( det <= 0)
			return true;
		else {
			// In paper this is:
			// Tr**2/Det < (r+1)**2/r
			return( Tr*Tr >= edgeThreshold*det);
		}
	}
760303
public boolean isSendRemoteMessage(BaseMessage message)
    {
        if (message instanceof RecordMessage)   // Always
        {
            RecordMessageHeader recMessageHeader = (RecordMessageHeader)message.getMessageHeader();
            int iChangeType = recMessageHeader.getRecordMessageType();
            if (m_iDatabaseType == recMessageHeader.getDatabaseType())
                if (DBParams.CLIENT.equals(recMessageHeader.getSourceType()))   // Don't send only if Client DB is handling these messages.
            {
                if (!(this instanceof GridRecordMessageFilter))
                    if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE)
                        || (iChangeType == DBConstants.AFTER_ADD_TYPE)
                        || (iChangeType == DBConstants.AFTER_DELETE_TYPE))
                            return false;    // The remote version of me handles this message remotely.
                if (this instanceof GridRecordMessageFilter)
                    if (iChangeType == DBConstants.AFTER_REQUERY_TYPE)
                        return false;    // The remote version of me handles this message remotely.
            }
        }
        return super.isSendRemoteMessage(message);
    }
565545
protected boolean shouldForward(TrustGraphAdvertisement message) {
        final int ttl = message.getInboundTTL();

        if (ttl <= 1 || ttl > getMaxRouteLength()) {
            return false;
        }
        return true;
    }
1160914
public void sendMessageToAllNeighbors(Message m) {
		if (edgesUsed) {
			throw new IllegalStateException("Can use either 'getOutgoingEdges()' or 'sendMessageToAllTargets()' exactly once.");
		}
		
		edgesUsed = true;
		
		outValue.f1 = m;
		
		while (edges.hasNext()) {
			Tuple next = (Tuple) edges.next();
			VertexKey k = next.getField(1);
			outValue.f0 = k;
			out.collect(outValue);
		}
	}
1010810
public final boolean isInferredConst() {
    if (nameNode == null) {
      return false;
    }

    return nameNode.getBooleanProp(Node.IS_CONSTANT_VAR)
        || nameNode.getBooleanProp(Node.IS_CONSTANT_NAME);
  }
253825
public boolean isBye() {
    if (message == null) {
      return false;
    }

    return (((Request) message).getMethod().equals(Request.BYE));
  }
278405
function isConstantFunction (node) {
  return isFunctionDefinition(node) && (
    node.attributes.constant === true ||
    node.attributes.stateMutability === 'view' ||
    node.attributes.stateMutability === 'pure'
  )
}
800521
function isInbound(network, id) {
  for( var i = 0; i < network.edge.in.length; i++ ) {
    if(id === network.edge.out[i].properties.hobbes.id) {
      return true;
    }
  }

  return false;
}
418391
public boolean isCommitted() {
		//the message is an incoming request for which a final response has been generated
		if(getTransaction() instanceof ServerTransaction &&
				(RoutingState.FINAL_RESPONSE_SENT.equals(routingState) || isFinalResponseGenerated)) {
			return true;
		}
		//the message is an outgoing request which has been sent
		if(getTransaction() instanceof ClientTransaction && this.isMessageSent) {
			return true;
		}
		/*
		if(Request.ACK.equals((((Request)message).getMethod()))) {
			return true;
		}*/
		return false;
	}
509008
def has_edge_evidence(self, u: BaseEntity, v: BaseEntity, key: str) -> bool:
        """"""
        return self._has_edge_attr(u, v, key, EVIDENCE)
988949
function isMultiplicationOfEqualNodes(node) {
  if (!Node.Type.isOperator(node) || node.op !== '*') {
    return false;
  }

  // return if they are all equal nodes
  return node.args.reduce((a, b) => {
    return a.equals(b);
  });

}
1308201
static boolean isConstantByConvention(
      CodingConvention convention, Node node) {
    Node parent = node.getParent();
    if (parent.isGetProp() && node == parent.getLastChild()) {
      return convention.isConstantKey(node.getString());
    } else if (mayBeObjectLitKey(node)) {
      return convention.isConstantKey(node.getString());
    } else if (node.isName()) {
      return convention.isConstant(node.getString());
    }
    return false;
  }