frompip._vendor.packaging.versionimportparseasparse_versionfrompip._internal.models.linkimportLinkfrompip._internal.utils.modelsimportKeyBasedCompareMixinclassInstallationCandidate(KeyBasedCompareMixin):"""Represents a potential "candidate" for installation."""__slots__=["name","version","link"]def__init__(self,name:str,version:str,link:Link)->None:self.name=nameself.version=parse_version(version)self.link=linksuper().__init__(key=(self.name,self.version,self.link),defining_class=InstallationCandidate,)def__repr__(self)->str:return"<InstallationCandidate({!r}, {!r}, {!r})>".format(self.name,self.version,self.link,)def__str__(self)->str:returnf"{self.name!r} candidate (version {self.version} at {self.link})"