code: def GenerateId(self, entity_id=None):
      
      self._idnum += 1
      if entity_id:
        return '%s_merged_%d' % (entity_id, self._idnum)
      else:
        return 'merged_%d' % self._idnum
docs: Generate a unique id based on the given id.
  
      This is done by appending a counter which is then incremented. The
      counter is initialised at the maximum number used as an ending for
      any id in the old and new schedules.
  
      Args:
        entity_id: The base id string. This is allowed to be None.
  
      Returns:
        The generated id.