boolean (@NotNull PyForStatement forStatement) { final PyExpression source = forStatement.getForPart().getSource(); if (!(source instanceof PyCallExpression expr)) { return false; } if (expr.isCalleeText("range", "xrange")) { final PyResolveContext resolveContext = PyResolveContext.defaultContext(myTypeEvalContext); final PyBuiltinCache builtinCache = PyBuiltinCache.getInstance(forStatement); return ContainerUtil.exists(expr.multiResolveCalleeFunction(resolveContext), builtinCache::isBuiltin); } return false; }