o
    £ý¸i   ã                   @  s.   d Z ddlmZ ddlmZ G dd„ dƒZdS )z:Helpers to convert tracked usage into billable quantities.é    )Úannotations)ÚIterablec                   @  s    e Zd ZdZddœdd
d„ZdS )ÚUsageCalculatorz-Summarize usage records into billable totals.N)ÚmetricÚrecordsúIterable[dict]r   ú
str | NoneÚreturnÚfloatc                C  s>   d}|D ]}|r|  d¡|krq|t|  dd¡pdƒ7 }q|S )Ng        r   Úvalue)Úgetr
   )Úselfr   r   r   Úrecord© r   ú$platform/billing/usage_calculator.pyÚtotal   s   zUsageCalculator.total)r   r   r   r   r	   r
   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r      s    r   N)r   Ú
__future__r   Útypingr   r   r   r   r   r   Ú<module>   s    