def _get_abstract_dist_for(self, req):<EOL>
assert self.require_hashes is not None, (<EOL>"<STR_LIT>"<EOL>)<EOL>if req.editable:<EOL><INDENT>return self.preparer.prepare_editable_requirement(<EOL>req, self.require_hashes, self.use_user_site, self.finder,<EOL>)<EOL><DEDENT>assert req.satisfied_by is None<EOL>skip_reason = self._check_skip_installed(req)<EOL>if req.satisfied_by:<EOL><INDENT>return self.preparer.prepare_installed_requirement(<EOL>req, self.require_hashes, skip_reason<EOL>)<EOL><DEDENT>upgrade_allowed = self._is_upgrade_allowed(req)<EOL>abstract_dist = self.preparer.prepare_linked_requirement(<EOL>req, self.session, self.finder, upgrade_allowed,<EOL>self.require_hashes<EOL>)<EOL>if not self.ignore_installed:<EOL><INDENT>req.check_if_exists(self.use_user_site)<EOL><DEDENT>if req.satisfied_by:<EOL><INDENT>should_modify = (<EOL>self.upgrade_strategy != "<STR_LIT>" or<EOL>self.force_reinstall or<EOL>self.ignore_installed or<EOL>req.link.scheme == '<STR_LIT:file>'<EOL>)<EOL>if should_modify:<EOL><INDENT>self._set_req_to_reinstall(req)<EOL><DEDENT>else:<EOL><INDENT>logger.info(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>', req,<EOL>)<EOL><DEDENT><DEDENT>return abstract_dist<EOL>
Takes a InstallRequirement and returns a single AbstractDist \
        representing a prepared variant of the same.