code: def _HasId(self, schedule, entity_id):
      
      try:
        self._GetById(schedule, entity_id)
        has = True
      except KeyError:
        has = False
      return has
docs: Check if the schedule has an entity with the given id.
  
      Args:
        schedule: The transitfeed.Schedule instance to look in.
        entity_id: The id of the entity.
  
      Returns:
        True if the schedule has an entity with the id or False if not.