def to_pipfile(self):
_LOGGER.debug("<STR_LIT>", self.name)<EOL>result = dict()<EOL>if self.index:<EOL><INDENT>result["<STR_LIT:index>"] = self.index.name<EOL><DEDENT>if self.markers:<EOL><INDENT>result["<STR_LIT>"] = self.markers<EOL><DEDENT>if not result:<EOL><INDENT>return {self.name: self.version}<EOL><DEDENT>result["<STR_LIT:version>"] = self.version<EOL>return {self.name: result}<EOL>
Generate Pipfile entry for the given package.