# Path: watcher_dashboard/utils/errors.py
# def handle_errors(error_message, error_default=None, request_arg=None):
#     def decorator(func):
#         def wrapper(*args, **kwargs):


import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard.api import base
from watcherclient import client as wc
from watcher_dashboard.utils import errors as errors_utils
        :type  parameters: dict

        :return: the updated Audit Template object
        :rtype:  :py:class:`~.AuditTemplate`
        """
        parameter_list = [{
            'name': str(name),
            'value': str(value),
        } for (name, value) in parameters.items()]
        audit_template = watcherclient(request).audit_template.patch(
            audit_template_id, parameter_list)
        return audit_template

    @classmethod
    def list(cls, request, **filters):
        """Return a list of audit templates in Watcher

        :param request: request object
        :type  request: django.http.HttpRequest

        :param filters: key/value kwargs used as filters
        :type  filters: dict

        :return: list of audit templates, or an empty list if there are none
        :rtype:  list of :py:class:`~.AuditTemplate`
        """
        return watcherclient(request).audit_template.list(
            detail=True, **filters)

    @classmethod

# Path: watcher_dashboard/utils/errors.py
# def handle_errors(error_message, error_default=None, request_arg=None):
#     def decorator(func):
#         def wrapper(*args, **kwargs):


# Path: watcher_dashboard/api/watcher.py
import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard.api import base
from watcherclient import client as wc
from watcher_dashboard.utils import errors as errors_utils

        :type  parameters: dict

        :return: the updated Audit Template object
        :rtype:  :py:class:`~.AuditTemplate`
        """
        parameter_list = [{
            'name': str(name),
            'value': str(value),
        } for (name, value) in parameters.items()]
        audit_template = watcherclient(request).audit_template.patch(
            audit_template_id, parameter_list)
        return audit_template

    @classmethod
    def list(cls, request, **filters):
        """Return a list of audit templates in Watcher

        :param request: request object
        :type  request: django.http.HttpRequest

        :param filters: key/value kwargs used as filters
        :type  filters: dict

        :return: list of audit templates, or an empty list if there are none
        :rtype:  list of :py:class:`~.AuditTemplate`
        """
        return watcherclient(request).audit_template.list(
            detail=True, **filters)

    @classmethod

    @errors_utils.handle_errors(_("Unable to retrieve audit template"))