def get_pkg_ver(pv, add_quotes=True):
    #XXX Fix package names with spaces bug.
    n = len(pv.split())
    if n == 2:
        #Normal package_name 1.0
        pkg_name, ver = pv.split()
    else:
        parts = pv.split()
        ver = parts[-1:]
        if add_quotes:
            pkg_name = "'%s'" % " ".join(parts[:-1])
        else:
            pkg_name = "%s" % " ".join(parts[:-1])
    return pkg_name, ver
Return package name and version
dataset/ETHPy150Open cakebread/yolk/tests/rss_feed.py/get_pkg_ver