<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def result_cached(task_id, wait=0, broker=None):
 """ Return the result from the cache backend """

    if not broker:
        broker = get_broker()
    start = time()
    while True:
        r = broker.cache.get('{}:{}'.format(broker.list_key, task_id))
        if r:
            return SignedPackage.loads(r)['result']
        if (time() - start) * 1000 >= wait >= 0:
            break
        sleep(0.01)