%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/thorium/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/thorium/calc.pyo

�
���^c@@sdZddlmZmZmZyddlZeZWnek
rQe	ZnXd�Z
dddd�Zdddd�Z
dddd�Zdddd�Zdddd	�Zdddd
�Zdddd�Zdddd�Zdddd
�ZdS(u�
Used to manage the thorium register. The thorium register is where compound
values are stored and computed, such as averages etc.

.. versionadded:: 2016.11.0

:depends: statistics PyPi module
i(tabsolute_importtprint_functiontunicode_literalsNcC@stS(u5
    The statistics module must be pip installed
    (t	HAS_STATS(((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyt__virtual__scC@s�i|d6id6dd6td6}|tkrNdj|�|d<t|d<nd�}d�}i|d	6|d
6tjd6tjd6tjd
6tjd6tj	d6tj
d6}	d}
g}t|dj�x]t|dD]M}|
d7}
|
|kr�Pn|dkr|j
|�q�|j
||�q�W|	||�}
|dkrc|
|krct|d<nd|koz|
knr�t|d<nit|�d6|d6|
d6|d<|S(u�
    Perform a calculation on the ``num`` most recent values. Requires a list.
    Valid values for ``oper`` are:

    - add: Add last ``num`` values together
    - mul: Multiple last ``num`` values together
    - mean: Calculate mean of last ``num`` values
    - median: Calculate median of last ``num`` values
    - median_low: Calculate low median of last ``num`` values
    - median_high: Calculate high median of last ``num`` values
    - median_grouped: Calculate grouped median of last ``num`` values
    - mode: Calculate mode of last ``num`` values

    USAGE:

    .. code-block:: yaml

        foo:
          calc.calc:
            - name: myregentry
            - num: 5
            - oper: mean
    unameuchangesuucommenturesultu{0} not found in registercS@s%d}x|D]}||}q
W|S(Ni((tvalstsumtval((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pytopadd<s
cS@s%d}x|D]}||}q
W|S(Ni((RtprodR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pytopmulBs
uaddumulumeanumedianu
median_lowumedian_highumedian_groupedumodeiuvaliuNumber of valuesuOperatoruAnswerN(tTruet__reg__tformattFalset
statisticstmeantmediant
median_lowtmedian_hightmedian_groupedtmodetreversetNonetappendtlen(tnametnumtopertminimumtmaximumtreftretRR
topstcountRtregitemtanswer((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pytcalcsL


		









c
C@s+td|d|ddd|d|d|�S(u�
    Adds together the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.add:
            - name: myregentry
            - num: 5
    RRRuaddRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pytaddos
c
C@s+td|d|ddd|d|d|�S(u�
    Multiplies together the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.mul:
            - name: myregentry
            - num: 5
    RRRumulRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pytmul�s
c
C@s+td|d|ddd|d|d|�S(u�
    Calculates the mean of the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.mean:
            - name: myregentry
            - num: 5
    RRRumeanRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyR�s
c
C@s+td|d|ddd|d|d|�S(u�
    Calculates the mean of the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.median:
            - name: myregentry
            - num: 5
    RRRumedianRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyR�s
c
C@s+td|d|ddd|d|d|�S(u�
    Calculates the low mean of the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.median_low:
            - name: myregentry
            - num: 5
    RRRu
median_lowRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyR�s
c
C@s+td|d|ddd|d|d|�S(u�
    Calculates the high mean of the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.median_high:
            - name: myregentry
            - num: 5
    RRRumedian_highRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyR�s
c
C@s+td|d|ddd|d|d|�S(u�
    Calculates the grouped mean of the ``num`` most recent values. Requires a
    list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.median_grouped:
            - name: myregentry
            - num: 5
    RRRumedian_groupedRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyR�sc
C@s+td|d|ddd|d|d|�S(u�
    Calculates the mode of the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.mode:
            - name: myregentry
            - num: 5
    RRRumodeRRR(R%(RRRRR((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyRs
(t__doc__t
__future__RRRRRRtImportErrorRRRR%R&R'RRRRRR(((s5/usr/lib/python2.7/site-packages/salt/thorium/calc.pyt<module>	s 


	S

Zerion Mini Shell 1.0