def multiply(data, params=None):
    """
    Multiply function aggregation.

    Example config:

    .. code-block:: python

        config = {
            ...
            'fields': ['timestamp', 'x'],
            'aggregations': [
                {
                    'func': 'multiply',
                    'field': 'x',
                    'params': {
                        'by': 10
                    }
                }
            ],
            ...
        }
    """
    kwargs = params or {}
    factor = kwargs.get('by', 1.0)
    return data * factor
