import json


def get_cache_key(args, kwargs):
    """
    Serialize arguments to get a cache key. It will be used to store function
    results.

    Returns:
        str: generated key
    """
    if len(args) == 0 and len(kwargs) == 0:
        return ""
    elif len(args) == 0:
        return json.dumps(kwargs)
    elif len(kwargs.keys()) == 0:
        return json.dumps(args)
    else:
        return json.dumps([args, kwargs])