@classmethod
def extend_filter(cls, *args, **kwargs):
    """Extend an existing gnocchi filter with multiple operations.

        :param lop: Logical operator in case of multiple filters.
        """
    lop = kwargs.get('lop', 'and')
    filter_list = []
    for cur_filter in args:
        if isinstance(cur_filter, dict) and cur_filter:
            filter_list.append(cur_filter)
        elif isinstance(cur_filter, list):
            filter_list.extend(cur_filter)
    if len(filter_list) > 1:
        return {lop: filter_list}
    else:
        return filter_list[0] if len(filter_list) else {}
