File manager - Edit - /opt/imunify360/venv/lib/python3.11/site-packages/diskcache/__pycache__/recipes.cpython-311.pyc
Back
� ��iJ: � �� � d Z ddlZddlZddlZddlZddlZddlZddlmZm Z m Z G d� d� � Z G d� d� � Z G d � d � � Z G d� d� � Zdddej ej fd �Zdd�Z dd�ZdS )zDisk Cache Recipes � N� )�ENOVAL�args_to_key� full_namec �, � e Zd ZdZdd�Zd� Zd� Zd� ZdS )�AverageraL Recipe for calculating a running average. Sometimes known as "online statistics," the running average maintains the total and count. The average can then be calculated at any time. Assumes the key will not be evicted. Set the eviction policy to 'none' on the cache to guarantee the key is not evicted. >>> import diskcache >>> cache = diskcache.FanoutCache() >>> ave = Averager(cache, 'latency') >>> ave.add(0.080) >>> ave.add(0.120) >>> ave.get() 0.1 >>> ave.add(0.160) >>> ave.pop() 0.12 >>> print(ave.get()) None Nc �>