def set_cache(key, data, ttl=300):
 _channel_repository_cache[key] = {'data': data, 'expires': (time.time() + ttl)}

def set_cache ( key , data , ttl = 300 ) : _channel_repository_cache [ key ] = { 'data' : data , 'expires' : ( time . time ( ) + ttl ) }
sets an in-memory cache value .