def make_key(args, kwargs):
    """Generate hash from arguments.

    Based on:
    https://github.com/python/cpython/blob/cd3c2bdd5d53db7fe1d546543d32000070916552/Lib/functools.py#L448
    """
    key = args
    if kwargs:
        key += (object(),)
        for item in kwargs.items():
            key += item
    return hash(key)