def get_data(user, length=4):
    
    cache_key = (length, user.replace(" ","+")) % 'user_%s:%s'
    
    data = None #cache.get(cache_key)
    while data == "locked":
        time.sleep(0.01)
    
    if not data:
        
        #cache.set(cache_key, "locked", 5)
        try:
            weeks = list(fetcher.weeks(user))
        except:
            import traceback
            try:
                errfile.write(traceback.format_exc())
                errfile.flush()
            except:
                pass
            return None, None
        threads = [ThreadedWeek(user, start, end) for start, end in weeks[-length:]]
        for thread in threads:
            thread.start()
        for thread in threads:
            thread.join()
        data = ([thread.data for thread in threads], weeks[-length:])
    
    #cache.set(cache_key, data, 30)
    
    return data
dataset/ETHPy150Open andrewgodwin/lastgraph/lastslice/slice.py/get_data/swapped operands of `%`