def mode(name, num, minimum=0, maximum=0, ref=None):
    '''
    Calculates the mode of the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.mode:
            - name: myregentry
            - num: 5
    '''
    return calc(
        name=name,
        num=num,
        oper='mode',
        minimum=minimum,
        maximum=maximum,
        ref=ref
    )
Calculates the mode of the ``num`` most recent values. Requires a list.

    USAGE:

    .. code-block:: yaml

        foo:
          calc.mode:
            - name: myregentry
            - num: 5