# Path: hypebot/core/inflect_lib.py
# def AddIndefiniteArticle(noun: AnyStr) -> AnyStr:
# def Ordinalize(number: int) -> AnyStr:
# def Plural(quantity: int, noun: AnyStr, plural: AnyStr = None) -> AnyStr:


from absl import logging
from hypebot.core import inflect_lib
from hypebot.protos.riot.v4 import constants_pb2
from hypebot.protos.riot.v4 import league_pb2
import arrow
    encrypted_summoner_id = summoner.get('encrypted_summoner_id', '')
    region = summoner.get('region', DEFAULT_REGION)
    r = self._rito.ListChampionMasteries(region, encrypted_summoner_id)
    if r:
      logging.info('Got champ mastery data for %s/%s [%s]', region,
                   encrypted_summoner_id, summoner['summoner'])
      # Calculate total number of chests received
      total_chests = sum(1 for x in r.champion_masteries if x.chest_granted)

      top_champs = []
      for champ in r.champion_masteries[:3]:
        top_champs.append(self._game.champion_id_to_name[str(
            champ.champion_id)])
      top_champ_lvl = r.champion_masteries[0].champion_level

      chest_verb = ''
      chest_verb_dict = {
          (0, 2): 'receiving',
          (2, 4): 'collecting',
          (4, 8): 'earning',
          (8, 16): 'amassing',
          (16, 32): 'hoarding'
      }
      for range_spec, verb in chest_verb_dict.items():
        if total_chests in range(*range_spec):
          chest_verb = verb
          break

      if chest_verb:
        chest_str = '%s %s' % (chest_verb,

# Path: hypebot/core/inflect_lib.py
# def AddIndefiniteArticle(noun: AnyStr) -> AnyStr:
# def Ordinalize(number: int) -> AnyStr:
# def Plural(quantity: int, noun: AnyStr, plural: AnyStr = None) -> AnyStr:


# Path: hypebot/plugins/league/summoner_lib.py
from absl import logging
from hypebot.core import inflect_lib
from hypebot.protos.riot.v4 import constants_pb2
from hypebot.protos.riot.v4 import league_pb2
import arrow

    encrypted_summoner_id = summoner.get('encrypted_summoner_id', '')
    region = summoner.get('region', DEFAULT_REGION)
    r = self._rito.ListChampionMasteries(region, encrypted_summoner_id)
    if r:
      logging.info('Got champ mastery data for %s/%s [%s]', region,
                   encrypted_summoner_id, summoner['summoner'])
      # Calculate total number of chests received
      total_chests = sum(1 for x in r.champion_masteries if x.chest_granted)

      top_champs = []
      for champ in r.champion_masteries[:3]:
        top_champs.append(self._game.champion_id_to_name[str(
            champ.champion_id)])
      top_champ_lvl = r.champion_masteries[0].champion_level

      chest_verb = ''
      chest_verb_dict = {
          (0, 2): 'receiving',
          (2, 4): 'collecting',
          (4, 8): 'earning',
          (8, 16): 'amassing',
          (16, 32): 'hoarding'
      }
      for range_spec, verb in chest_verb_dict.items():
        if total_chests in range(*range_spec):
          chest_verb = verb
          break

      if chest_verb:
        chest_str = '%s %s' % (chest_verb,

                               inflect_lib.Plural(total_chests, 'chest'))