from typing import List
from typing import Dict
from typing import Any


def _get_trimming_index(sysmon: List[Dict[str, Any]]) -> int:
    """
    Find index after which isn't mainly noise
    :param sysmon: List of Sysmon events
    :return: The index in the list of Sysmon events where events that we care about start
    """
    index = 0
    for event in sysmon:
        event_data = event["EventData"]
        for data in event_data["Data"]:
            val = data["@Name"]
            if not data.get("#text"):
                continue
            if val == "ParentCommandLine" and 'C:\\Users\\buddy\\AppData\\Local\\Temp\\' in data["#text"]:
                # Okay now we have our baseline, everything before this was noise
                # get index of eventdata
                index = sysmon.index(event)
                return index
    return index