<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, item):
 """ Add a collector item. Args: item (CollectorUpdate):
 event data like stage, timestampe and status. """

        if item.matrix not in self.data:
            self.data[item.matrix] = []

        result = Select(self.data[item.matrix]).where(
            lambda entry: entry.stage == item.stage).build()

        if len(result) > 0:
            stage = result[0]
            stage.status = item.status
            stage.add(item.timestamp, item.information)
        else:
            stage = CollectorStage(stage=item.stage, status=item.status)
            stage.add(item.timestamp, item.information)
            self.data[item.matrix].append(stage)