import typing


def find_section_in_list(
    section: typing.List[typing.Any], action: typing.Dict[str, typing.Any], key: str
) -> int:
    """
    Find index of section in list
    :param section: list, where we want to search
    :param action: action dictionary
    :param key: the key marker
    :return: index of searched section
    """
    key = key[1:]
    if key.isdigit():
        return int(key)
    if key not in action:
        raise KeyError("Action {}: marker {} not found in action".format(action, key))
    compares = action[key]

    for index, section in enumerate(section):
        if all(section[compare["key"]] == compare["value"] for compare in compares):
            return index
    raise IndexError(
        "Action {}: Value with {} filters not found".format(action, compares)
    )