code: def _MergeSameAgency(self, a_agency_id, b_agency_id):
      
      a_agency_id = (a_agency_id or
                     self.feed_merger.a_schedule.GetDefaultAgency().agency_id)
      b_agency_id = (b_agency_id or
                     self.feed_merger.b_schedule.GetDefaultAgency().agency_id)
      a_agency = self.feed_merger.a_schedule.GetAgency(
          a_agency_id)._migrated_entity
      b_agency = self.feed_merger.b_schedule.GetAgency(
          b_agency_id)._migrated_entity
      if a_agency != b_agency:
        raise MergeError('agency must be the same')
      return a_agency.agency_id
docs: Merge agency ids to the corresponding agency id in the merged schedule.
  
      Args:
        a_agency_id: an agency id from the old schedule
        b_agency_id: an agency id from the new schedule
  
      Returns:
        The agency id of the corresponding merged agency.
  
      Raises:
        MergeError: If a_agency_id and b_agency_id do not correspond to the same
                    merged agency.
        KeyError: Either aaid or baid is not a valid agency id.