def notify_owner(f):
 @functools.wraps(f)
 def wrapper(*args, **kwargs):
  '\n        if request.args.get(\'confirmed\') == "true":\n            dag_id = request.args.get(\'dag_id\')\n            task_id = request.args.get(\'task_id\')\n            dagbag = models.DagBag(\n                os.path.expanduser(configuration.get(\'core\', \'DAGS_FOLDER\')))\n\n            dag = dagbag.get_dag(dag_id)\n            task = dag.get_task(task_id)\n\n            if current_user and hasattr(current_user, \'username\'):\n                user = current_user.username\n            else:\n                user = \'anonymous\'\n\n            if task.owner != user:\n                subject = (\n                    \'Actions taken on DAG {0} by {1}\'.format(\n                        dag_id, user))\n                items = request.args.items()\n                content = Template(\'\'\'\n                    action: <i>{{ f.__name__ }}</i><br>\n                    <br>\n                    <b>Parameters</b>:<br>\n                    <table>\n                    {% for k, v in items %}\n                        {% if k != \'origin\' %}\n                            <tr>\n                                <td>{{ k }}</td>\n                                <td>{{ v }}</td>\n                            </tr>\n                        {% endif %}\n                    {% endfor %}\n                    </table>\n                    \'\'\').render(**locals())\n                if task.email:\n                    send_email(task.email, subject, content)\n        '
  return f(*args, **kwargs)
 return wrapper

def notify_owner ( f ) : @ functools . wraps ( f ) def wrapper ( * args , ** kwargs ) : return f ( * args , ** kwargs ) return wrapper
a decorator for mutating methods of property container classes that notifies owners of the property container about mutating changes .