Returns whether a node has an inferrable value or not
@param {ASTNode} node the node to check
@param {ASTNode} init the initializer
@returns {boolean} whether the node has an inferrable type
176101
function isInferrable(node, init) {
            if (node.type !== "TSTypeAnnotation" || !node.typeAnnotation) {
                return false;
            }

            if (!init) {
                return false;
            }

            const annotation = node.typeAnnotation;

            if (annotation.type === "TSStringKeyword") {
                return (
                    (init.type === "Literal" &&
                        typeof init.value === "string") ||
                    (init.type === "TemplateElement" &&
                        (!init.expressions || init.expressions.length === 0))
                );
            }

            if (annotation.type === "TSBooleanKeyword") {
                return init.type === "Literal";
            }

            if (annotation.type === "TSNumberKeyword") {
                // Infinity is special
                if (
                    (init.type === "UnaryExpression" &&
                        init.operator === "-" &&
                        init.argument.type === "Identifier" &&
                        init.argument.name === "Infinity") ||
                    (init.type === "Identifier" && init.name === "Infinity")
                ) {
                    return true;
                }

                return (
                    init.type === "Literal" && typeof init.value === "number"
                );
            }

            return false;
        }
241268
function initChildren(node, isAsc) {
    var children = node.children || [];

    node.children = sort(children, isAsc);

    // Init children recursively
    if (children.length) {
        zrUtil.each(node.children, function (child) {
            initChildren(child, isAsc);
        });
    }
}
1175007
private static boolean isInsideInstanceMember(Node n) {
    while (n != null) {
      if (n.isMemberFunctionDef()
          || n.isGetterDef()
          || n.isSetterDef()
          || n.isComputedProp()) {
        return !n.isStaticMember();
      }
      if (n.isClass()) {
        // Stop at the first enclosing class.
        return false;
      }
      n = n.getParent();
    }
    return false;
  }
530178
function (node) {
        var parent = node;

        while (parent) {
          if (parent.nodeType === 1 && dom.getContentEditable(parent)) {
            return dom.getContentEditable(parent) === "false" ? parent : node;
          }

          parent = parent.parentNode;
        }

        return node;
      }
390924
function(node) {
            var parent = node.getParent();
            while(parent) {
                if(parent._id === this._id) {
                    return true;
                }
                parent = parent.getParent();
            }

            return false;
        }
41275
function(type, node) {
    return seen.indexOf(node) == -1 && ((type == 'AssignmentExpression' && node.right == expr) || (type == 'VariableDeclarator' && node.init == expr));
  }
1100489
function isIElementNode(node) {
    return typeof node['getText'] === 'function' &&
        typeof node.currently['hasText'] === 'function' &&
        typeof node.currently['hasAnyText'] === 'function' &&
        typeof node.currently['containsText'] === 'function' &&
        typeof node.wait['hasText'] === 'function' &&
        typeof node.wait['hasAnyText'] === 'function' &&
        typeof node.wait['containsText'] === 'function' &&
        typeof node.eventually['hasText'] === 'function' &&
        typeof node.eventually['hasAnyText'] === 'function' &&
        typeof node.eventually['containsText'] === 'function' &&
        typeof node['getDirectText'] === 'function' &&
        typeof node.currently['hasDirectText'] === 'function' &&
        typeof node.currently['hasAnyDirectText'] === 'function' &&
        typeof node.currently['containsDirectText'] === 'function' &&
        typeof node.wait['hasDirectText'] === 'function' &&
        typeof node.wait['hasAnyDirectText'] === 'function' &&
        typeof node.wait['containsDirectText'] === 'function' &&
        typeof node.eventually['hasDirectText'] === 'function' &&
        typeof node.eventually['hasAnyDirectText'] === 'function' &&
        typeof node.eventually['containsDirectText'] === 'function';
}
854229
function isInFinally(node) {
    for (
        let currentNode = node;
        currentNode && currentNode.parent && !astUtils.isFunction(currentNode);
        currentNode = currentNode.parent
    ) {
        if (currentNode.parent.type === "TryStatement" && currentNode.parent.finalizer === currentNode) {
            return true;
        }
    }

    return false;
}
862953
function isContextSensitive(node) {
            ts.Debug.assert(node.kind !== 147 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
            switch (node.kind) {
                case 179 /* FunctionExpression */:
                case 180 /* ArrowFunction */:
                    return isContextSensitiveFunctionLikeDeclaration(node);
                case 171 /* ObjectLiteralExpression */:
                    return ts.forEach(node.properties, isContextSensitive);
                case 170 /* ArrayLiteralExpression */:
                    return ts.forEach(node.elements, isContextSensitive);
                case 188 /* ConditionalExpression */:
                    return isContextSensitive(node.whenTrue) ||
                        isContextSensitive(node.whenFalse);
                case 187 /* BinaryExpression */:
                    return node.operatorToken.kind === 52 /* BarBarToken */ &&
                        (isContextSensitive(node.left) || isContextSensitive(node.right));
                case 253 /* PropertyAssignment */:
                    return isContextSensitive(node.initializer);
                case 147 /* MethodDeclaration */:
                case 146 /* MethodSignature */:
                    return isContextSensitiveFunctionLikeDeclaration(node);
                case 178 /* ParenthesizedExpression */:
                    return isContextSensitive(node.expression);
            }
            return false;
        }
272396
function isInBooleanContext(node, parent) {
            return (
                (BOOLEAN_NODE_TYPES.indexOf(parent.type) !== -1 &&
                    node === parent.test) ||

                // !<bool>
                (parent.type === "UnaryExpression" &&
                    parent.operator === "!")
            );
        }
1112544
function reportInferrableType(node, typeNode, initNode) {
            if (!typeNode || !initNode || !typeNode.typeAnnotation) {
                return;
            }

            if (!isInferrable(typeNode, initNode)) {
                return;
            }

            const typeMap = {
                TSBooleanKeyword: "boolean",
                TSNumberKeyword: "number",
                TSStringKeyword: "string",
            };

            const type = typeMap[typeNode.typeAnnotation.type];

            context.report({
                node,
                message:
                    "Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.",
                data: {
                    type,
                },
                fix: fixer => fixer.remove(typeNode),
            });
        }
407209
def infer_callable(node, context=None):
    
    if len(node.args) != 1:
        # Invalid callable call.
        raise UseInferenceDefault

    argument = node.args[0]
    try:
        inferred = next(argument.infer(context=context))
    except InferenceError:
        return util.Uninferable
    if inferred is util.Uninferable:
        return util.Uninferable
    return nodes.Const(inferred.callable())
1218243
function hasParams(node) {
    return isObject(node) &&
           isArray(node.params) &&
           node.params.length > 0;
}
1282401
function _isBlankNode(v) {
  // Note: A value is a blank node if all of these hold true:
  // 1. It is an Object.
  // 2. If it has an @id key its value begins with '_:'.
  // 3. It has no keys OR is not a @value, @set, or @list.
  var rval = false;
  if(_isObject(v)) {
    if('@id' in v) {
      rval = (v['@id'].indexOf('_:') === 0);
    }
    else {
      rval = (Object.keys(v).length === 0 ||
        !(('@value' in v) || ('@set' in v) || ('@list' in v)));
    }
  }
  return rval;
}
437830
private static boolean isPureIterable(Node node) {
    switch (node.getToken()) {
      case ARRAYLIT:
      case STRING:
      case TEMPLATELIT:
        return true; // These iterables are known to be pure.
      default:
        return false; // Anything else, including a non-iterable (e.g. `null`), would be impure.
    }
  }
1275701
function isComputedMacro(node) {
  var type = node.type;
  if (type !== "CallExpression") {
    return false;
  }
  var callee = node.callee;
  var calleeType = callee.type;
  if (calleeType === "MemberExpression") {
    if (callee.object.name === "computed") {
      return true;
    }
    if (callee.object.type === "MemberExpression") {
      var coon = callee.object.object.name;
      var copn = callee.object.property.name || callee.object.property.value;
      if (isEmber(coon) && copn === "computed") {
        return true;
      }
    }
  }
  return false;
}
1010810
public final boolean isInferredConst() {
    if (nameNode == null) {
      return false;
    }

    return nameNode.getBooleanProp(Node.IS_CONSTANT_VAR)
        || nameNode.getBooleanProp(Node.IS_CONSTANT_NAME);
  }