(fragment, canonical_name)
return version
Parse the version string from a <package>+<version> filename
    "fragment" (stem) or egg fragment.

    :param fragment: The string to parse. E.g. foo-2.1
    :param canonical_name: The canonicalized name of the package this
        belongs to.
Parse the version string from a <package>+<version> filename
    "fragment" (stem) or egg fragment.
Parse the version string from a <package > + <version > filename fragment ( stem ) or egg fragment .
def _extract_version_from_fragment(fragment, canonical_name):
    # type: (str, str) -> Optional[str]
    """Parse the version string from a <package>+<version> filename
    "fragment" (stem) or egg fragment.

    :param fragment: The string to parse. E.g. foo-2.1
    :param canonical_name: The canonicalized name of the package this
        belongs to.
    """
    try:
        version_start = _find_name_version_sep(fragment, canonical_name) + 1
    except ValueError:
        return None
    version = fragment[version_start:]
    if not version:
        return None
    return version
def _extract_version_from_fragment ( fragment , canonical_name ) : # type: (str, str) -> Optional[str] try : version_start = _find_name_version_sep ( fragment , canonical_name ) + 1 except ValueError : return None version = fragment [ version_start : ] if not version : return None return version