private Collection<PackageElement> getImportedPackages() {
		Set<PackageElement> packages = new HashSet<>();
		for (TypeElement element : getImportedTypes()) {
			if (isNestedType(element)) {
				// don't import types declared in this file
				continue;
			}

			PackageElement importedPkg = getPackage(element);
			if (importedPkg == null || el.equals(importedPkg)) {
				continue;
			}
			packages.add(importedPkg);
		}

		List<PackageElement> res = new ArrayList<>(packages);
		res.sort(PythonTypeStubElement::compareQualifiedNameable);
		return res;
	}
Gets a collection of all imported packages

@return a collection of all imported packages
GhidraBuild/BuildFiles/Doclets/src/main/java/ghidra/doclets/typestubs/PythonTypeStubPackage.java