code: def SetActiveBreakpoints(self, breakpoints_data):
      
      with self._lock:
        ids = set([x['id'] for x in breakpoints_data])
  
        # Clear breakpoints that no longer show up in active breakpoints list.
        for breakpoint_id in six.viewkeys(self._active) - ids:
          self._active.pop(breakpoint_id).Clear()
  
        # Create new breakpoints.
        self._active.update([
            (x['id'],
             python_breakpoint.PythonBreakpoint(
                 x,
                 self._hub_client,
                 self,
                 self.data_visibility_policy))
            for x in breakpoints_data
            if x['id'] in ids - six.viewkeys(self._active) - self._completed])
  
        # Remove entries from completed_breakpoints_ that weren't listed in
        # breakpoints_data vector. These are confirmed to have been removed by the
        # hub and the debuglet can now assume that they will never show up ever
        # again. The backend never reuses breakpoint IDs.
        self._completed &= ids
  
        if self._active:
          self._next_expiration = datetime.min  # Not known.
        else:
          self._next_expiration = datetime.max
docs: Adds new breakpoints and removes missing ones.
  
      Args:
        breakpoints_data: updated list of active breakpoints.