boolean (final String name) { if (myNamedElements == null || myImportedNameDefiners == null) { collectDeclarations(); } // Check for isGlobal is omitted intentionally, since it visits nested scopes. // Thus, containsDeclaration would always return false for globals. if (isNonlocal(name)) { return false; } if (!getNamedElements(name, true).isEmpty()) { return true; } if (isAugAssignment(name)) { return true; } for (PyImportedNameDefiner definer : getImportedNameDefiners()) { if (!definer.multiResolveName(name).isEmpty()) { return true; } } return false; }