def cache(func):
    # type: ignore # CANNOT_INFER_FUNC_TYPE
    """Decorator which applies Django caching to a function.

       Uses a key based on the function's name, filename, and
       the repr() of its arguments."""

    func_uniqifier = (func.__code__.co_filename, func.__name__) % '%s-%s'

    @wraps(func)
    def keyfunc(*args, **kwargs):
        # type: (*Any, **Any) -> str
        # Django complains about spaces because memcached rejects them
        key = func_uniqifier + repr((args, kwargs))
        return key.replace('-', '--').replace(' ', '-s')

    return cache_with_key(keyfunc)(func)
dataset/ETHPy150Open zulip/zulip/zerver/lib/cache.py/cache/swapped operands of `%`