<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _HasId(self, schedule, entity_id):
 """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. """

    try:
      self._GetById(schedule, entity_id)
      has = True
    except KeyError:
      has = False
    return has