def hash_key(*args, **kwargs):
    """Return a cache key for the specified hashable arguments."""

    if kwargs:
        return cachetools.keys._HashedTuple(args + _kwargs_mark + tuple(itertools.chain(sorted(kwargs.items()))))
    else:
        return cachetools.keys._HashedTuple(args)
Return a cache key for the specified hashable arguments.