Splits the given package name and returns a tuple (name, ver).
493920
def split_package_name(p):
    """"""
    s = p.split(six.u('=='))
    if len(s) == 1:
        return (to_text(s[0]), None)
    else:
        return (to_text(s[0]), to_text(s[1]))
466420
def _pkg_names(pkg):
        
        parts = pkg.split('.')
        while parts:
            yield '.'.join(parts)
            parts.pop()
413860
def packagenameify(s):
  
  return ''.join(w if w in ACRONYMS else w.title() for w in s.split('.')[-1:])
265845
def Split(axis, a, n):
    
    return tuple(np.split(np.copy(a), n, axis=axis))
99283
def zip(name, options = {})
      url = options.fetch(:url)
      remote_source = RemoteSources::Zip.new(url)
      packages << Package.new(name, remote_source, options)
    end
1280683
def search_pkg(name, repo):
    
    PACKAGES_TXT = Utils().read_file(_meta_.lib_path + "{0}_repo/"
                                     "PACKAGES.TXT".format(repo))
    names = Utils().package_name(PACKAGES_TXT)
    blacklist = BlackList().packages(pkgs=names, repo=repo)
    for line in PACKAGES_TXT.splitlines():
        status(0)
        if line.startswith("PACKAGE NAME:  ") and len(line) > 16:
            pkg_name = split_package(line[15:])[0].strip()
            if name == pkg_name and name not in blacklist:
                return pkg_name
348359
def sub(v1, v2):
    '''
    '''
    return tuple(a - b for a, b in zip(v1, v2))
272248
def parse_package_extended(identifier):
    
    match = EXTENDED_PACKAGE_RE.match(identifier)
    if match is None:
        raise ValueError

    full_name, pkg_hash, version, tag = match.groups()
    team, user, name, subpath = parse_package(full_name, allow_subpath=True)

    # namedtuple return value
    return PackageInfo(full_name, team, user, name, subpath, pkg_hash, version, tag)
319930
private static String convertResourceName(Class<?> klass, String resource) {
        if (resource.startsWith("/")) {
            // "absolute" resource, chop the slash
            return resource.substring(1);
        } else {
            String className = klass.getName();
            int i = className.lastIndexOf('.');
            if (i < 0) {
                // no package
                return resource;
            } else {
                // need to be relative to the package
                String packageName = className.substring(0, i);
                String packagePath = packageName.replace('.', '/');
                return packagePath + "/" + resource;
            }
        }
    }
35748
def ParseMultiple(self, result_dicts):
    """"""
    status = rdf_client.SoftwarePackage.InstallState.INSTALLED

    packages = []
    for result_dict in result_dicts:
      result = result_dict.ToDict()

      # InstalledOn comes back in a godawful format such as '7/10/2013'.
      installed_on = self.AmericanDateToEpoch(result.get("InstalledOn", ""))
      packages.append(
          rdf_client.SoftwarePackage(
              name=result.get("HotFixID"),
              description=result.get("Caption"),
              installed_by=result.get("InstalledBy"),
              install_state=status,
              installed_on=installed_on))

    if packages:
      yield rdf_client.SoftwarePackages(packages=packages)
907633
def get_package_filename(filename, package_dir=None):
    ''''''
    if getattr(sys, 'frozen', False):
        package_dir = os.path.join(
            sys._MEIPASS,
            os.path.basename(os.path.dirname(__file__))
        )
    elif not package_dir:
        package_dir = os.path.dirname(__file__)

    return os.path.join(package_dir, filename)
256769
public String parsePackageName(PackageElement p) {
        String pkgname = p.isUnnamed() ? "" : getPackageName(p);
        int index = -1;
        for (int j = 0; j < MAX_CONSTANT_VALUE_INDEX_LENGTH; j++) {
            index = pkgname.indexOf(".", index + 1);
        }
        if (index != -1) {
            pkgname = pkgname.substring(0, index);
        }
        return pkgname;
    }
1355927
def _split_repo_str(repo):
    '''
    
    '''
    split = sourceslist.SourceEntry(repo)
    return split.type, split.architectures, split.uri, split.dist, split.comps
1057097
def to_package(self, repo_url):
        """"""
        return Package(name=self.name, url=repo_url + self.name)
586123
def _rmv_pkg(self, package):
        
        removes = []
        if GetFromInstalled(package).name() and package not in self.skip:
            ver = GetFromInstalled(package).version()
            removes.append(package + ver)
            self._removepkg(package)
        return removes
314865
def split_qname(qname):
        """"""
        res = qname.split(YinParser.ns_sep)
        if len(res) == 1:       # no namespace
            return None, res[0]
        else:
            return res
873766
def getClassInPackageFromName(className, pkg):
    
    # TODO: more efficiency!
    n = getAvClassNamesInPackage(pkg)
    i = n.index(className)
    c = getAvailableClassesInPackage(pkg)
    return c[i]