def METHOD_NAME(
    self,
    *,
    operations: Set[PrimitiveOperation],
    key_types: Set[KeyType],
    client_parameters: ClientParameters,
) -> Dict[str, Dict[Parameter, int]]:
    """
    Count the amount of specified operations in the program and group by tags and parameters.
    Args:
        operations (Set[PrimitiveOperation]):
            set of operations used to filter the statistics
        key_types (Set[KeyType]):
            set of key types used to filter the statistics
        client_parameters (ClientParameters):
            client parameters required for grouping by parameters
    Returns:
        Dict[str, Dict[Parameter, int]]:
            number of specified operations per tag per parameter in the program
    """
    result: Dict[str, Dict[int, int]] = {}
    for statistic in self.statistics:
        if statistic.operation not in operations:
            continue
        tag, _, _ = re.match(REGEX_LOCATION, statistic.location).groups()
        # remove the @
        tag = tag[1:] if tag else ""
        tag_components = tag.split(".")
        for i in range(1, len(tag_components) + 1):
            current_tag = ".".join(tag_components[0:i])
            if current_tag == "":
                continue
            if current_tag not in result:
                result[current_tag] = {}
            for key_type, key_index in statistic.keys:
                if key_type not in key_types:
                    continue
                parameter = Parameter(client_parameters, key_type, key_index)
                if parameter not in result[current_tag]:
                    result[current_tag][parameter] = 0
                result[current_tag][parameter] += statistic.count
    return result