<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def persist_checksum(self, requirement, cache_file):
 """ Persist the checksum of the input used to generate a binary distribution. :param requirement: A :class:`.Requirement` object. :param cache_file: The pathname of a cached binary distribution (a string). .. note:: The checksum is only calculated and persisted when :attr:`~.Config.trust_mod_times` is :data:`False`. """

        if not self.config.trust_mod_times:
            checksum_file = '%s.txt' % cache_file
            with AtomicReplace(checksum_file) as temporary_file:
                with open(temporary_file, 'w') as handle:
                    handle.write('%s\n' % requirement.checksum)