<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_links(self, parent, children):
 """Create dependency links from parent to child. Any sensors not in the tree are added. After all dependency links have been created, the parent is recalculated and the tree attaches to any sensors it was not yet attached to. Links that already exist are ignored. Parameters parent : :class:`katcp.Sensor` object The sensor that depends on children. children : sequence of :class:`katcp.Sensor` objects The sensors parent depends on. """

        new_sensors = []
        if parent not in self:
            self._add_sensor(parent)
            new_sensors.append(parent)
        for child in children:
            if child not in self:
                self._add_sensor(child)
                new_sensors.append(child)
            self._parent_to_children[parent].add(child)
            self._child_to_parents[child].add(parent)

        self.recalculate(parent, children)
        for sensor in new_sensors:
            sensor.attach(self)