# Path: api/cache.py
# def get_cache_key(name: str, kwargs: dict):
#     key_parts = [name]
#     if kwargs:
#         key_parts.append(KWARG_MARK)
#         key_parts.extend(sorted(kwargs.items()))
#     return str(hash(tuple(key_parts)))


from http import HTTPStatus
from werkzeug.contrib.cache import BaseCache
from api.cache import get_cache_key
import logging
import aiohttp
                            'response': json
                        }
                        logger.info('Caching etag and response: {}'.format(new_etag))
                        self.cache.set(cache_key, cache_payload)
                    return json

    async def user_repos(self, username: str, sort: str='pushed'):
        cache_key = get_cache_key('user_repos', {
            'username': username,
            'sort': sort
        })
        return await self.make_request(
            '/users/{username}/repos'.format(username=username),
            params={'sort': sort},
            cache_key=cache_key
        )

    async def repo_tags(self, username: str, repo: str):
        cache_key = get_cache_key('repo_tags', {
            'username': username,
            'repo': repo
        })
        return await self.make_request(
            '/repos/{username}/{repo}/tags'.format(
                username=username, repo=repo
            ),
            cache_key=cache_key
        )

    async def compare(self, username: str, repo: str, base: str, head='HEAD'):

# Path: api/cache.py
# def get_cache_key(name: str, kwargs: dict):
#     key_parts = [name]
#     if kwargs:
#         key_parts.append(KWARG_MARK)
#         key_parts.extend(sorted(kwargs.items()))
#     return str(hash(tuple(key_parts)))


# Path: api/github/client.py
from http import HTTPStatus
from werkzeug.contrib.cache import BaseCache
from api.cache import get_cache_key
import logging
import aiohttp

                            'response': json
                        }
                        logger.info('Caching etag and response: {}'.format(new_etag))
                        self.cache.set(cache_key, cache_payload)
                    return json

    async def user_repos(self, username: str, sort: str='pushed'):
        cache_key = get_cache_key('user_repos', {
            'username': username,
            'sort': sort
        })
        return await self.make_request(
            '/users/{username}/repos'.format(username=username),
            params={'sort': sort},
            cache_key=cache_key
        )

    async def repo_tags(self, username: str, repo: str):
        cache_key = get_cache_key('repo_tags', {
            'username': username,
            'repo': repo
        })
        return await self.make_request(
            '/repos/{username}/{repo}/tags'.format(
                username=username, repo=repo
            ),
            cache_key=cache_key
        )

    async def compare(self, username: str, repo: str, base: str, head='HEAD'):

        cache_key = get_cache_key('compare', {