<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def truncate(self, index, chain):
 """ Truncate the trace array to some index. :Parameters: index : int The index within the chain after which all values will be removed. chain : int The chain index (>=0). """

        self._trace[chain] = self._trace[chain][:index]