To get all the versions of packageVOs(including archive) based on package name
@param packageName
@return
@throws CachingException
772608
public static List<Package> getAllPackages(String packageName) throws CachingException {
        List<Package> allPackages = new ArrayList<>();
        for (Package packageVO : getPackageList()) {
            if (packageVO.getName().equals(packageName)) {
                allPackages.add(packageVO);
            }
        }
        return allPackages;
    }
192714
private static Package getPackage(Long processInstanceId) {
        try {
            EventServices eventManager = ServiceLocator.getEventServices();
            Process process = eventManager.findProcessByProcessInstanceId(processInstanceId);
            Package packageVO = PackageCache.getProcessPackage(process.getId());
            return packageVO;
        }
        catch (Exception ex) {
            return null;
        }
    }
1129916
public static String getVersionCode(Context context) {
        if (sVersion == null) {
            try {
                sVersion = context.getPackageManager().getPackageInfo(
                        context.getPackageName(), 0).versionName;
            } catch (PackageManager.NameNotFoundException e) {
                // Can't find version; just leave it blank.
                Log.e(TAG, "Error finding package " + context.getApplicationInfo().packageName);
            }
        }
        return sVersion;
    }
604012
def get_package_versions(package_name):
    
    package_manager = _get_package_manager()
    pkg = package_manager.get_package_version(package_name, None)
    return pkg.package_versions()
419892
public static List<Class<?>> getClasses(String packageName) throws IOException, ClassNotFoundException {
        List<Class<?>> classes = new ArrayList<>();
        String packageDirName = packageName.replace('.', '/');
        Enumeration<URL> dirs = Thread.currentThread().getContextClassLoader().getResources(packageDirName);
        while (dirs.hasMoreElements()) {
            URL url = dirs.nextElement();
            String protocol = url.getProtocol();
            if ("file".equals(protocol)) {
                String filePath = URLDecoder.decode(url.getFile(), "UTF-8");
                addClassesInPackageByFile(packageName, filePath, classes);
            } else if ("jar".equals(protocol)) {
                JarFile jar = ((JarURLConnection) url.openConnection()).getJarFile();
                Enumeration<JarEntry> entries = jar.entries();
                while (entries.hasMoreElements()) {
                    JarEntry entry = entries.nextElement();
                    String name = entry.getName();
                    if (name.charAt(0) == '/') {
                        name = name.substring(1);
                    }
                    if (name.startsWith(packageDirName)) {
                        int idx = name.lastIndexOf('/');
                        if (idx != -1) {
                            packageName = name.substring(0, idx).replace('/', '.');
                        }
                        if (name.endsWith(".class") && !entry.isDirectory()) {
                            String className = name.substring(packageName.length() + 1, name.length() - 6);
                            classes.add(Class.forName(packageName + '.' + className));
                        }
                    }
                }
            }
        }
        return classes;
    }
605878
@Trivial
    public static DCache getCache(String cacheName) {

        final String methodName = "getCache()";
        DCache cacheOut = ServerCache.cache;

        if (cacheName != null) {
            cacheName = normalizeCacheName(cacheName, null);
        }

        if (cacheName != null && !cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_CACHE_NAME)) {
            cacheOut = cacheInstances.get(cacheName);
        }

        if (cacheOut == null && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + " could not find cache for cacheName=" + cacheName);
        }

        return cacheOut;
    }
1113894
public Version version(String versionName, boolean pool) throws VersionException, RepositoryException
   {
      JCRName jcrVersionName = locationFactory.parseJCRName(versionName);
      VersionImpl version =
         (VersionImpl)dataManager.getItem(nodeData(), new QPathEntry(jcrVersionName.getInternalName(), 1), pool,
            ItemType.NODE, false);
      if (version == null)
      {
         throw new VersionException("There are no version with name '" + versionName + "' in the version history "
            + getPath());
      }

      return version;
   }
894803
public <K, V> Cache<K, V> initCache(final String _cacheName)
    {
        if (!exists(_cacheName)
                        &&  ((EmbeddedCacheManager) getContainer()).getCacheConfiguration(_cacheName) == null) {
            ((EmbeddedCacheManager) getContainer()).defineConfiguration(_cacheName, "eFaps-Default",
                            new ConfigurationBuilder().build());
        }
        return this.container.getCache(_cacheName, true);
    }
464934
protected void addCachedExtensionVersion(String feature, E extension)
    {
        // versions
        List<E> versions = this.extensionsVersions.get(feature);

        if (versions == null) {
            versions = new ArrayList<E>();
            this.extensionsVersions.put(feature, versions);

            versions.add(extension);
        } else {
            int index = 0;
            while (index < versions.size()
                && extension.getId().getVersion().compareTo(versions.get(index).getId().getVersion()) < 0) {
                ++index;
            }

            versions.add(index, extension);
        }
    }
232688
public JIBXContextHolder get(String packageName, String bindingName) throws JiBXException
    {
    	String version = null;	// Eventually add this to calling method params
        synchronized(this)
        {
            JIBXContextHolder jAXBContextHolder = super.get(packageName);
            if (jAXBContextHolder == null)
            {
            	if (bindingName == null)
            		bindingName = DEFAULT_BINDING_NAME;
            	ClassLoader classLoader = null;
            	try {
					classLoader = ClassServiceUtility.getClassService().getBundleClassLoader(packageName, version);
				} catch (ClassNotFoundException e) {
					e.printStackTrace();
				}
    			IBindingFactory jc = BindingDirectory.getFactory(bindingName, packageName, classLoader);
                jAXBContextHolder = new JIBXContextHolder(jc);
                this.put(packageName, jAXBContextHolder);
            }
            return jAXBContextHolder;
        }
    }
1099654
public static function getPackageVersion($composerName)
    {
        foreach (self::readComposerLock() as $composerLockData) {
            if (!isset($composerLockData['name'])) {
                continue;
            }
            if ($composerLockData['name'] === $composerName) {
                return preg_replace('/^v([0-9])/', '$1', $composerLockData['version'], 1);
            }
        }

        return '';
    }
1368572
protected function getPackage($packageName)
    {
        try {
            $package = $this->packagist->get($packageName);
            $this->getOutput()->writeln(sprintf(
                'Package to install: <info>%s</info> (%s)',
                $package->getName(),
                $package->getDescription()
            ));
            $this->requirePackage($package);
        } catch (ClientErrorResponseException $e) {
            $this->searchPackage($packageName);
        }
    }
662016
protected function decorate($packageName)
    {
        $results = $this->repository->findPackages($packageName);

        if (!count($results)) {
            throw new \InvalidArgumentException('Could not find package with specified name ' . $packageName);
        }

        $latest   = array_slice($results, 0, 1)[0];
        $versions = array_slice($results, 1);
        $package  = new VersionedPackage($latest, $versions);

        return $this->decorateWithPackagistStats($package);
    }
1029577
def package_version(package_name: str) -> typing.Optional[str]:
    

    try:
        return pkg_resources.get_distribution(package_name).version
    except (pkg_resources.DistributionNotFound, AttributeError):
        return None
899614
public ImmutableSet<ClassInfo> getTopLevelClassesRecursive(String packageName) {
    checkNotNull(packageName);
    String packagePrefix = packageName + '.';
    ImmutableSet.Builder<ClassInfo> builder = ImmutableSet.builder();
    ImmutableSet<ClassInfo> topLevelClasses = getTopLevelClasses();
    List<String> debugData = Lists.newLinkedList();
    for (ClassInfo classInfo : topLevelClasses) {
      if (classInfo.getName().startsWith(packagePrefix)) {
        builder.add(classInfo);
        debugData.add(classInfo.getResourceName() + "\n");
      }
    }
    return builder.build();
  }
1142571
protected function getPackageVersion(PackageEntity $package, $packageVersion, &$isBastMatch = null)
    {
        if ($packageVersion === 'best-match-version') {
            $isBastMatch = true;
            $result = null;
            if ($this->request->query->has('v')) {
                $v = $this->request->query->get('v');
                if (is_string($v) && $v !== '') {
                    $versionComparer = new VersionComparer();
                    $result = $versionComparer->matchPackageVersionEntities($package->getVersions(), $v);
                }
            }
        } else {
            $isBastMatch = false;
            $result = $this->app->make(PackageVersionRepository::class)->findByHandleAndVersion($package->getHandle(), $packageVersion);
        }

        return $result;
    }
1166452
private static void getTypeVariablePackageNames(TypeVariable type,
      Map<String, Class<?>> packageNames) {
    for (Type boundType : type.getBounds()) {
      getTypePackageNames(boundType, packageNames);
    }
  }