<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_data(self, data):
 """ The function called when new data has arrived. :param data: The list of data records received. """

        for d in data:
            self._populate_sub_entity(d, 'Device')
            self._populate_sub_entity(d, 'Rule')
            date = dates.localize_datetime(d['activeFrom'])
            click.echo(
                '[{date}] {device} ({rule})'.format(date=date, device=d['device'].get('name', '**Unknown Vehicle'),
                                                    rule=d['rule'].get('name', '**Unknown Rule')))