code: def _FindLargestIdPostfixNumber(self, schedule):
      
      postfix_number_re = re.compile('(\d+)$')
  
      def ExtractPostfixNumber(entity_id):
        """Try to extract an integer from the end of entity_id.
  
        If entity_id is None or if there is no integer ending the id, zero is
        returned.
  
        Args:
          entity_id: An id string or None.
  
        Returns:
          An integer ending the entity_id or zero.
        """
        if entity_id is None:
          return 0
        match = postfix_number_re.search(entity_id)
        if match is not None:
          return int(match.group(1))
        else:
          return 0
  
      id_data_sets = {'agency_id': schedule.GetAgencyList(),
                      'stop_id': schedule.GetStopList(),
                      'route_id': schedule.GetRouteList(),
                      'trip_id': schedule.GetTripList(),
                      'service_id': schedule.GetServicePeriodList(),
                      'fare_id': schedule.GetFareAttributeList(),
                      'shape_id': schedule.GetShapeList()}
  
      max_postfix_number = 0
      for id_name, entity_list in id_data_sets.items():
        for entity in entity_list:
          entity_id = getattr(entity, id_name)
          postfix_number = ExtractPostfixNumber(entity_id)
          max_postfix_number = max(max_postfix_number, postfix_number)
      return max_postfix_number
docs: Finds the largest integer used as the ending of an id in the schedule.
  
      Args:
        schedule: The schedule to check.
  
      Returns:
        The maximum integer used as an ending for an id.