human
Complete this python program:
def main():
assistant
#Here is the Python code you requested.

    """Modify key (supplied in jinja2 dot notation) in yaml file, setting
    the key to the desired value.
    """
    global module
    module = AnsibleModule(argument_spec=dict(dest=dict(required=True), yaml_key=dict(required=True), yaml_value=dict(required=True), backup=dict(required=False, default=True, type='bool')), supports_check_mode=True)
    dest = module.params['dest']
    yaml_key = module.params['yaml_key']
    yaml_value = module.safe_eval(module.params['yaml_value'])
    backup = module.params['backup']
    def none_representer(dumper, data):
        return yaml.ScalarNode(tag=u'tag:yaml.org,2002:null', value=u'')
    yaml.add_representer(type(None), none_representer)
    try:
        with open(dest) as yaml_file:
            yaml_data = yaml.safe_load(yaml_file.read())
        changes = set_key(yaml_data, yaml_key, yaml_value)
        if (len(changes) > 0):
            if backup:
                module.backup_local(dest)
            with open(dest, 'w') as yaml_file:
                yaml_string = yaml.dump(yaml_data, default_flow_style=False)
                yaml_string = yaml_string.replace("''", '""')
                yaml_file.write(yaml_string)
        return module.exit_json(changed=(len(changes) > 0), changes=changes)
    except Exception as error:
        return module.fail_json(msg=str(error))