def declension(num: int, one: str, two: str, five: str):
    n = num % 100
    if 11 <= n <= 19:
        return f'{str(num)} {five}'
    else:
        i = n % 10
        if i == 1:
            return f'{str(num)} {one}'
        elif i in [2, 3, 4]:
            return f'{str(num)} {two}'
        else:
            return f'{str(num)} {five}'


def load_repos() -> list:
    while True:
        try:
            resp = requests.get("https://git.mootfrost.dev/api/v1/repos/search",
                                params={'limit': 64,
                                        'sort': 'updated',
                                        'order': 'desc'}).json()
        except RequestException as e:
            logging.error(f'{datetime.now()}: Error while updating projects: {e}')
            return
    repos = []
    for repo in resp['data']:
        repos.append(Project(repo["name"], repo["description"], repo["html_url"]))
    return repos

__all__ = ['declension']
