def source_with_constants(self, constants):
old_lines = self.source().split("<STR_LIT:\n>")<EOL>info = self.__extract_info(old_lines)<EOL>new_lines = old_lines[<NUM_LIT:0>:info['<STR_LIT>']]<EOL>for constant, value in sorted(constants.items()):<EOL><INDENT>new_lines.append("<STR_LIT>".format(info['<STR_LIT>'], str(constant), str(value)))<EOL><DEDENT>new_lines.extend(old_lines[info['<STR_LIT>']:])<EOL>return "<STR_LIT:\n>".join(new_lines)<EOL>
Returns the source of the module with the class that acts like a namespace for constants with new constants.

:param dict[str,int] constants: The new constants.

:rtype: str