def to_dict(self, is_lock: bool = False):
_LOGGER.debug("<STR_LIT>", "<STR_LIT>" if not is_lock else "<STR_LIT>")<EOL>sources_dict = [source.to_dict() for source in self.sources.values()]<EOL>result = {}<EOL>if is_lock:<EOL><INDENT>result["<STR_LIT>"] = sources_dict<EOL>result["<STR_LIT>"] = self.requires or {}<EOL>result["<STR_LIT>"] = self.hash<EOL>result["<STR_LIT>"] = self.pipfile_spec or _DEFAULT_PIPFILE_SPEC<EOL><DEDENT>else:<EOL><INDENT>result["<STR_LIT:source>"] = sources_dict<EOL>if self.pipenv:<EOL><INDENT>result["<STR_LIT>"] = self.pipenv<EOL><DEDENT>if self.requires:<EOL><INDENT>result["<STR_LIT>"] = self.requires<EOL><DEDENT><DEDENT>return result<EOL>
Produce sources as a dict representation as stated in Pipfile/Pipfile.lock.