[docs]defparse_dependencies(dependencies:list[str])->dict[str,str]:"""Transform a list of dependencies into a dictionary of dependencies, with package name as key."""parsed={}fordependencyindependencies:ifdependency.startswith("-e"):pkg_repo,pkg_name=dependency.rsplit("/",1)ifpkg_nameinparsed:raiseValueError(f"Duplicate package name {pkg_name} in dependencies.")parsed[pkg_name]=pkg_repo+"/"+pkg_nameelse:pkg_name,pkg_version=dependency.split("==")ifpkg_nameinparsed:raiseValueError(f"Duplicate package name {pkg_name} in dependencies.")parsed[pkg_name]=pkg_versionreturnparsed