def METHOD_NAME(requests, yaml_file):
    yaml_result = []
    with open(yaml_file, 'a') as y_f:
        id_ev = 0
        for req, event in requests:
            type_ev = event['data']['type']
            stage_ev = type_ev.title()
            mode = None
            agent_id = callback_analysisd_agent_id(req) or '000'
            del event['data']['mode']
            del event['data']['type']
            if 'tags' in event['data']:
                del event['data']['tags']
            if type_ev == 'added':
                mode = 'save2'
                output_ev = json.dumps(event['data'])
            elif type_ev == 'deleted':
                mode = 'delete'
                output_ev = json.dumps(event['data']['path']).replace('"', '')
            elif type_ev == 'modified':
                mode = 'save2'
                for field in ['old_attributes', 'changed_attributes', 'content_changes']:
                    if field in event['data']:
                        del event['data'][field]
                output_ev = json.dumps(event['data'])
            yaml_result.append({
                'name': f"{stage_ev}{id_ev}",
                'test_case': [
                    {
                        'input': f"{req}",
                        'output': f"agent {agent_id} syscheck {mode} {output_ev}",
                        'stage': f"{stage_ev}"
                    }
                ]
            })
            id_ev += 1
        y_f.write(yaml.safe_dump(yaml_result))