<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_least_batch_id(self, txn_signature):
 """Set the first batch id that doesn't have all results. Args: txn_signature (str):
 The txn identifier of the transaction with results being set. """


        batch = self._batches_by_txn_id[txn_signature]

        least_index = self._index_of_batch(
            self._batches_by_id[self._least_batch_id_wo_results].batch)

        current_index = self._index_of_batch(batch)
        all_prior = False

        if current_index <= least_index:
            return
            # Test to see if all batches from the least_batch to
            # the prior batch to the current batch have results.
        if all(
                all(t.header_signature in self._txn_results
                    for t in b.transactions)
                for b in self._batches[least_index:current_index]):
            all_prior = True
        if not all_prior:
            return
        possible_least = self._batches[current_index].header_signature
        # Find the first batch from the current batch on, that doesn't have
        # all results.
        for b in self._batches[current_index:]:
            if not all(t.header_signature in self._txn_results
                       for t in b.transactions):
                possible_least = b.header_signature
                break
        self._least_batch_id_wo_results = possible_least