# Buggy code
def _post_monitor(module, options):
    try:
        kwargs = dict(
            type=module.params["type"],
            query=module.params["query"],
            name=_fix_template_vars(module.params["name"]),
            message=_fix_template_vars(module.params["message"]),
            escalation_message=_fix_template_vars(module.params["escalation_message"]),
            options=options,
        )
        if module.params["tags"] is not None:
            kwargs["tags"] = module.params["tags"]
        msg = api.Monitor.create(**kwargs)
        if "errors" in msg:
            module.fail_json(msg=str(msg["errors"]))
        else:
            module.exit_json(changed=True, msg=msg)
    except Exception as e:
        module.fail_json(msg=to_native(e), exception=traceback.format_exc())


# Traceback (TypeError)
The full traceback is:
Traceback (most recent call last):
File "/home/kevin/.ansible/tmp/ansible-tmp-1536342721.9100335-54055516095596/AnsiballZ_datadog_monitor.py", line 113, in <module>
_ansiballz_main()
File "/home/kevin/.ansible/tmp/ansible-tmp-1536342721.9100335-54055516095596/AnsiballZ_datadog_monitor.py", line 105, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/kevin/.ansible/tmp/ansible-tmp-1536342721.9100335-54055516095596/AnsiballZ_datadog_monitor.py", line 48, in invoke_module
imp.load_module('__main__', mod, module, MOD_DESC)
File "/usr/lib64/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/usr/lib64/python3.6/imp.py", line 170, in load_source
module = _exec(spec, sys.modules[name])
File "<frozen importlib._bootstrap>", line 618, in _exec
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/tmp/ansible_datadog_monitor_payload_2zuzk2lj/__main__.py", line 343, in <module>
File "/tmp/ansible_datadog_monitor_payload_2zuzk2lj/__main__.py", line 179, in main
File "/tmp/ansible_datadog_monitor_payload_2zuzk2lj/ansible_datadog_monitor_payload.zip/ansible/module_utils/basic.py", line 900, in __init__
File "/tmp/ansible_datadog_monitor_payload_2zuzk2lj/ansible_datadog_monitor_payload.zip/ansible/module_utils/basic.py", line 2242, in _log_invocation
File "/tmp/ansible_datadog_monitor_payload_2zuzk2lj/ansible_datadog_monitor_payload.zip/ansible/module_utils/basic.py", line 2200, in log
TypeError: send() got multiple values for keyword argument 'MESSAGE'

# Fixed code
def _post_monitor(module, options):
    try:
        kwargs = dict(
            type=module.params["type"],
            query=module.params["query"],
            name=_fix_template_vars(module.params["name"]),
            message=_fix_template_vars(module.params["notification_message"]),
            escalation_message=_fix_template_vars(module.params["escalation_message"]),
            options=options,
        )
        if module.params["tags"] is not None:
            kwargs["tags"] = module.params["tags"]
        msg = api.Monitor.create(**kwargs)
        if "errors" in msg:
            module.fail_json(msg=str(msg["errors"]))
        else:
            module.exit_json(changed=True, msg=msg)
    except Exception as e:
        module.fail_json(msg=to_native(e), exception=traceback.format_exc())