def get_attr_flows(results, key='variable_costs'):
    """
    Return all flows of an EnergySystem for a given attribute,
    which is not zero.

    Parameters
    ----------
    results : dict
        Results dicionary of the oemof.solph optimisation including the
        Parameters with key 'param'.
    key : str

    Returns
    -------
    list : List of flows, where a non zero attribute value is given either
           at the 'scalars' or 'sequences'.
    """
    param = results['param']

    list_keys = list(param.keys())

    var_scalars = [
        x for x in list_keys
        if key in param[x]['scalars'].keys()
        if abs(param[x]['scalars'][key]) > 0
    ]

    var_sequences = [
        x for x in list_keys
        if key in param[x]['sequences'].keys()
        if abs(param[x]['sequences'][key].sum()) > 0
    ]

    var_cost_flows = var_scalars + var_sequences

    return var_cost_flows