<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_inputs(self, indices=None):
 """Converts a Transaction's outputs to spendable inputs. Note: Takes the Transaction's outputs and derives inputs from that can then be passed into `Transaction.transfer` as `inputs`. A list of integers can be passed to `indices` that defines which outputs should be returned as inputs. If no `indices` are passed (empty list or None) all outputs of the Transaction are returned. Args: indices (:obj:`list` of int):
 Defines which outputs should be returned as inputs. Returns: :obj:`list` of :class:`~bigchaindb.common.transaction. Input` """

        # NOTE: If no indices are passed, we just assume to take all outputs
        #       as inputs.
        indices = indices or range(len(self.outputs))
        return [
            Input(self.outputs[idx].fulfillment,
                  self.outputs[idx].public_keys,
                  TransactionLink(self.id, idx))
            for idx in indices
        ]