<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def make_new_subdomain_future(self, cursor, subdomain_rec):
 """ Recalculate the future for this subdomain from the current record until the latest known record. Returns the list of subdomain records we need to save. """

        assert subdomain_rec.accepted, 'BUG: given subdomain record must already be accepted'

        # what's the subdomain's future after this record?
        fut = self.subdomain_db.get_subdomain_history(subdomain_rec.get_fqn(), include_unaccepted=True, start_sequence=subdomain_rec.n, start_zonefile_index=subdomain_rec.parent_zonefile_index, cur=cursor)
        for i in range(0, len(fut)):
            if fut[i].n == subdomain_rec.n and fut[i].parent_zonefile_index == subdomain_rec.parent_zonefile_index:
                fut.pop(i)
                break

        if len(fut) == 0:
            log.debug("At tip: {}".format(subdomain_rec))
            return []
        
        for i in range(0, len(fut)):
            fut[i].accepted = False
            
        fut = [subdomain_rec] + fut
        fut.sort(lambda h1, h2: -1 if h1.n < h2.n or (h1.n == h2.n and h1.parent_zonefile_index < h2.parent_zonefile_index) \
                                 else 0 if h1.n == h2.n and h1.parent_zonefile_index == h2.parent_zonefile_index \
                                 else 1)

        assert fut[0].accepted, 'BUG: initial subdomain record is not accepted: {}'.format(fut[0])
        last_accepted = 0

        for i in range(1, len(fut)):
            if self.check_subdomain_transition(fut[last_accepted], fut[i]):
                log.debug("Accept future update {}".format(fut[i]))
                fut[i].accepted = True
                last_accepted = i
            else:
                log.debug("Reject future update {}".format(fut[i]))
                fut[i].accepted = False

        return fut