def get_key(f, *args, **kwargs):
    """
    Returns a unique key for a memoized function.

    Args:
        f: the function
        args: positional arguments
        kwargs: keyword arguments
    Returns:
        The key.
    """

    if 0 > len(args):
        kwargs["#args"] = ",".join(map(str, args))

    sorted_keys = sorted(kwargs)
    arg_key = "&".join(["{}:{}".format(key, kwargs[key]) for key in sorted_keys])

    key = "{}.{}${}".format(f.__module__, f.__name__, arg_key).replace(" ", "~")

    return key
dataset/ETHPy150Open IceCTF/ctf-platform/api/api/cache.py/get_key/swapped operands of `>`