Determines whether the given node is a class-defining name, like
"inherits" or "mixin."
@return The type of class-defining name, or null.
483810
private static SubclassType typeofClassDefiningName(Node callName) {
    // Check if the method name matches one of the class-defining methods.
    String methodName = null;
    if (callName.isGetProp()) {
      methodName = callName.getLastChild().getString();
    } else if (callName.isName()) {
      String name = callName.getString();
      int dollarIndex = name.lastIndexOf('$');
      if (dollarIndex != -1) {
        methodName = name.substring(dollarIndex + 1);
      }
    }

    if (methodName != null) {
      if (methodName.equals("inherits")) {
        return SubclassType.INHERITS;
      } else if (methodName.equals("mixin")) {
        return SubclassType.MIXIN;
      }
    }
    return null;
  }
581914
static boolean isClassExpression(Node n) {
    return n.isClass() && (!isNamedClass(n) || !isDeclarationParent(n.getParent()));
  }
503418
private JSType getJSType(Node n) {
    JSType jsType = n.getJSType();
    if (jsType == null) {
      // TODO(nicksantos): This branch indicates a compiler bug, not worthy of
      // halting the compilation but we should log this and analyze to track
      // down why it happens. This is not critical and will be resolved over
      // time as the type checker is extended.
      return unknownType;
    } else {
      return jsType;
    }
  }
898792
private static boolean _isAllOfSameType(Node[] nodes, short type) {
	for (int i = 0; i < nodes.length; i++) {
	    if (nodes[i].getNodeType() != type) return false;
	}
	return true;
    }
1255731
def is_constructor(node):
    
    return (
        node.parent
        and isinstance(node.parent.scope(), astroid.nodes.ClassDef)
        and node.name == "__init__"
    )
1346368
private Class nodeClass(XmlParser.Node node) throws ClassNotFoundException
    {
        String className = node.getAttribute("class");
        if (className == null) return null;

        return Loader.loadClass(XmlConfiguration.class, className);
    }
466050
public ClassNode lookupClassNodeFor(String type) {
        for (ClassNode cn : typeCheckingVisitor.getSourceUnit().getAST().getClasses()) {
            if (cn.getName().equals(type))
                return cn;
        }

        return null;
    }
1158040
private JSType getVarNameType(Scope scope, String name) {
    Var var = scope.getVar(name);
    JSType type = null;
    if (var != null) {
      Node nameDefinitionNode = var.getNode();
      if (nameDefinitionNode != null) {
        type = nameDefinitionNode.getJSType();
      }
    }
    if (type == null) {
      // TODO(bradfordcsmith): Consider throwing an error if the type cannot be found.
      type = unknownType;
    }
    return type;
  }
233402
function() {
					var full;
					if (node.hasClass(cls)) {
						return node.get(0);
					} else {
						full = node.find('.' + cls);
						if (full.length) {
							return full.get(0);
						}
					}
					return null;
				}
643472
@SuppressWarnings("unchecked")
    public static Class<Object> getInnerClassType(Class<?> declaringClass, String name) throws ClassNotFoundException {
        return (Class<Object>) Class.forName(declaringClass.getName() + "$" + name);
    }
432195
public static boolean isNamedElement(final Node aNode) {

        final boolean isElementNode = aNode != null && aNode.getNodeType() == Node.ELEMENT_NODE;

        return isElementNode
                && getNamedAttribute(aNode, NAME_ATTRIBUTE) != null
                && !getNamedAttribute(aNode, NAME_ATTRIBUTE).isEmpty();
    }
1225012
@Override
  public SubclassRelationship getClassesDefinedByCall(Node callNode) {
    SubclassRelationship relationship =
        super.getClassesDefinedByCall(callNode);
    if (relationship != null) {
      return relationship;
    }

    Node callName = callNode.getFirstChild();
    SubclassType type = typeofClassDefiningName(callName);
    if (type != null) {
      Node subclass = null;
      Node superclass = callNode.getLastChild();

      // There are four possible syntaxes for a class-defining method:
      // goog.inherits(SubClass, SuperClass)
      // goog$inherits(SubClass, SuperClass)
      // goog.mixin(SubClass.prototype, SuperClass.prototype)
      // goog$mixin(SubClass.prototype, SuperClass.prototype)
      if (callNode.hasXChildren(3)) {
        // goog.inherits(SubClass, SuperClass)
        subclass = callName.getNext();
      } else {
        return null;
      }

      if (type == SubclassType.MIXIN) {
        // Only consider mixins that mix two prototypes as related to
        // inheritance.
        if (!endsWithPrototype(superclass)) {
          return null;
        }
        if (!endsWithPrototype(subclass)) {
          return null;
        }
        // Strip off the prototype from the name.
        subclass = subclass.getFirstChild();
        superclass = superclass.getFirstChild();
      }

      // bail out if either of the side of the "inherits"
      // isn't a real class name. This prevents us from
      // doing something weird in cases like:
      // goog.inherits(MySubClass, cond ? SuperClass1 : BaseClass2)
      if (subclass != null
          && subclass.isUnscopedQualifiedName()
          && superclass.isUnscopedQualifiedName()) {
        return new SubclassRelationship(type, subclass, superclass);
      }
    }

    return null;
  }
558646
private Class<?> nodeClass(Element node) throws ClassNotFoundException {
		String className = getAttribute(node, "class");
		if (className == null) {
			return null;
		}

		return Loader.loadClass(DOMJettyWebXmlParser.class, className, true);
	}
192866
@Nullable
  private static Node getSubclassForEs6Superclass(Node superclass) {
    Node classNode = superclass.getParent();
    checkArgument(classNode.isClass(), classNode);
    if (NodeUtil.isNameDeclaration(classNode.getGrandparent())) {
      // const Clazz = class extends Super {
      return classNode.getParent();
    } else if (superclass.getGrandparent().isAssign()) {
      // ns.foo.Clazz = class extends Super {
      return classNode.getPrevious();
    } else if (NodeUtil.isClassDeclaration(classNode)) {
      // class Clazz extends Super {
      return classNode.getFirstChild();
    }
    return null;
  }
488032
private JSType getJSType(Node n) {
    JSType jsType = n.getJSType();
    if (jsType == null) {
      // TODO(nicksantos): This branch indicates a compiler bug, not worthy of
      // halting the compilation but we should log this and analyze to track
      // down why it happens. This is not critical and will be resolved over
      // time as the type checker is extended.
      return getNativeType(UNKNOWN_TYPE);
    } else {
      return jsType;
    }
  }
1067598
public static boolean isElement(Node node) {
		return (null == node) ? false : Node.ELEMENT_NODE == node.getNodeType();
	}
1074866
function isIndependentType(node) {
            switch (node.kind) {
                case 117 /* AnyKeyword */:
                case 132 /* StringKeyword */:
                case 130 /* NumberKeyword */:
                case 120 /* BooleanKeyword */:
                case 133 /* SymbolKeyword */:
                case 103 /* VoidKeyword */:
                case 135 /* UndefinedKeyword */:
                case 93 /* NullKeyword */:
                case 127 /* NeverKeyword */:
                case 166 /* LiteralType */:
                    return true;
                case 160 /* ArrayType */:
                    return isIndependentType(node.elementType);
                case 155 /* TypeReference */:
                    return isIndependentTypeReference(node);
            }
            return false;
        }