Return true if a tree represents a diamond new expr.
500797
public static boolean isDiamond(JCTree tree) {
        switch(tree.getTag()) {
            case TYPEAPPLY: return ((JCTypeApply)tree).getTypeArguments().isEmpty();
            case NEWCLASS: return isDiamond(((JCNewClass)tree).clazz);
            case ANNOTATED_TYPE: return isDiamond(((JCAnnotatedType)tree).underlyingType);
            default: return false;
        }
    }
103822
private static boolean isDefault(Tree<Node> tree){
		Tree<Node> flag = tree;
		while(!flag.isLeaf()&&flag.children.size()==1)
			flag = flag.getFirstChild();
		if(flag.isLeaf()&&flag.label.getTag().equals("-NONE-"))
			return true;
		else
			return false;
	}
1119309
private boolean isAttributeAxis(SimpleNode node) {
        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
            if (((SimpleNode) node.jjtGetChild(i)).getId() == JJTAT) {
                return true;
            }
        }
        return false;
    }
246599
public boolean isPreviousThan(Node node) {
        if (getEndLine() < node.getBeginLine()) {
            return true;
        } else if ((getEndLine() == node.getBeginLine()) && (getEndColumn() <= node.getBeginColumn())) {
            return true;
        }
        return false;
    }
722275
boolean isIdenticalTree(MathNode aTree, MathNode bTree) {
        // first check if they have the same number of children
        if (aTree.equals(bTree) && aTree.getChildren().size() == bTree.getChildren().size()) {
            if (aTree.isOrderSensitive()) {
                // all children order sensitive
                for (int i = 0; i < aTree.getChildren().size(); i++) {
                    if (!isIdenticalTree(aTree.getChildren().get(i), bTree.getChildren().get(i))) {
                        return false;
                    }
                }
            } else {
                // order insensitive
                List<MathNode> bChildren = new ArrayList<>(bTree.getChildren());
                OUTER:
                for (MathNode aChild : aTree.getChildren()) {
                    for (MathNode bChild : filterSameChildren(aChild, bChildren)) {
                        if (isIdenticalTree(aChild, bChild)) {
                            // found an identical child
                            bChildren.remove(bChild);
                            continue OUTER;
                        }
                    }
                    // aChild is missing in bChildren
                    return false;
                }
            }
            return true;
        }
        return false;
    }
975144
def is_list(node):
    """"""
    return (isinstance(node, Node)
            and len(node.children) > 1
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[-1], Leaf)
            and node.children[0].value == u"["
            and node.children[-1].value == u"]")
50945
function isSubScopeWithTopLevelUnAssignedBinOp (node) {
  return nodeType(node, exactMatch(nodeTypes.BLOCK)) && node.children && node.children.some(isBinaryOpInExpression) ||
          isSubScopeStatement(node) && node.children && node.children.some(isBinaryOpInExpression) // Second Case for if without braces
}
1250319
def is_leaf(obj):
    '''
        
    '''
    if(is_dict(obj)):
        length = obj.__len__()
        if(length == 0):
            return(True)
        else:
            return(False)
    else:
        return(True)
193394
def find_if_expression_as_statement(node):
    """"""
    return (
        isinstance(node, ast.Expr)
        and isinstance(node.value, ast.IfExp)
    )
615010
function hasNestedDefine(ast) {
	var result = false;

	types.visit(ast, {
		visitCallExpression: function(path) {
			if (this.isDefineExpression(path)) {
				result = true;
				this.abort();
			}

			this.traverse(path);
		},

		// whether a non top level `define(` is call in the AST
		isDefineExpression: function(path) {
			return (
				n.Identifier.check(path.node.callee) &&
				path.node.callee.name === "define" &&
				!n.Program.check(path.parent.parent.node)
			);
		}
	});

	return result;
}
1167596
private boolean validRecordTypeExpression(Node expr) {
    // The expression must have at least two children. The record keyword and
    // a record expression
    if (!checkParameterCount(expr, Keywords.RECORD)) {
      return false;
    }
    // Each child must be a valid record
    for (int i = 0; i < getCallParamCount(expr); i++) {
      if (!validRecordParam(getCallArgument(expr, i))) {
        warnInvalidInside(Keywords.RECORD.name, expr);
        return false;
      }
    }
    return true;
  }
52661
def is_in_expr(expr, find):
  """"""
  return expr == find or (isinstance(expr, ExprNode) and expr.is_in(find))
312148
def match(self, node, results=None):
        """"""
        if not isinstance(node, Leaf):
            return False
        return BasePattern.match(self, node, results)
1167710
def visit_BoolOp(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        op = node.op
        with self.op_man(op):
            src = self.visit(op).join([self.visit(node.values[0])] +
                                      [self.visit(val, dfltChaining=False)
                                       for val in node.values[1:]])
            return self.wrap_expr(src, dfltChaining)
736188
private boolean validTypeTransformationExpression(Node expr) {
    if (!isValidExpression(expr)) {
      warnInvalidExpression("type transformation", expr);
      return false;
    }
    if (isTypeVar(expr) || isTypeName(expr)) {
      return true;
    }
    // Check for valid keyword
    String name = getCallName(expr);
    if (!isValidKeyword(name)) {
      warnInvalidExpression("type transformation", expr);
      return false;
    }
    Keywords keyword = nameToKeyword(name);
    // Check the rest of the expression depending on the kind
    switch (keyword.kind) {
      case TYPE_CONSTRUCTOR:
        return validTypeExpression(expr);
      case OPERATION:
        return validOperationExpression(expr);
      default:
        throw new IllegalStateException("Invalid type transformation expression");
    }
  }
768100
def is_in(self, expr):
    """"""
    if expr == self:
      return True
    is_in_left = is_in_expr(self.left, expr)
    is_in_right = is_in_expr(self.right, expr)
    return is_in_left or is_in_right
712624
def visit_Expr(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        return self.visit(node.value)