class_docstr: The result of a single model analysis run.
  
  Attributes:
    slicing_metrics: a list of `tfma.SlicedMetrics`, containing metric values
      for each slice.
    plots: List of slice-plot pairs.
    attributions: List of SlicedAttributions containing attribution values for
      each slice.
    config: The config containing slicing and metrics specification.
    data_location: Optional location for data used with config.
    file_format: Optional format for data used with config.
    model_location: Optional location(s) for model(s) used with config.
docstr: Get attribution feature keys and values for every slice.
  
  Args:
    metric_name: Name of metric to get attributions for. Optional if only one
      metric used.
    output_name: The name of the output (optional, only used for multi-output
      models).
    class_id: Used with multi-class metrics to identify a specific class ID.
    k: Used with multi-class metrics to identify the kth predicted value.
    top_k: Used with multi-class and ranking metrics to identify top-k
      predicted values.
  
  Returns:
    Dictionary mapping slices to attribution feature keys and values.
docstr_tok: ["Get","attribution","feature","keys","and","values","for","every","slice",".","Args",":","metric_name",":","Name","of","metric","to","get","attributions","for",".","Optional","if","only","one","metric","used",".","output_name",":","The","name","of","the","output","(","optional",",","only","used","for","multi-output","models",")",".","class_id",":","Used","with","multi-class","metrics","to","identify","a","specific","class","ID",".","k",":","Used","with","multi-class","metrics","to","identify","the","kth","predicted","value",".","top_k",":","Used","with","multi-class","and","ranking","metrics","to","identify","top-k","predicted","values",".","Returns",":","Dictionary","mapping","slices","to","attribution","feature","keys","and","values","."]
code: def get_attributions_for_all_slices(
      self,
      metric_name: str = "",
      output_name: str = "",
      class_id: Optional[int] = None,
      k: Optional[int] = None,
      top_k: Optional[int] = None,
  ) -> Dict[str, AttributionsByFeatureKey]:
      """Get attribution feature keys and values for every slice.
  
      Args:
        metric_name: Name of metric to get attributions for. Optional if only one
          metric used.
        output_name: The name of the output (optional, only used for multi-output
          models).
        class_id: Used with multi-class metrics to identify a specific class ID.
        k: Used with multi-class metrics to identify the kth predicted value.
        top_k: Used with multi-class and ranking metrics to identify top-k
          predicted values.
  
      Returns:
        Dictionary mapping slices to attribution feature keys and values.
      """
  
      if class_id or k or top_k:
          sub_key = str(metric_types.SubKey(class_id, k, top_k))
      else:
          sub_key = ""
  
      all_sliced_attributions = {}
      for sliced_attributions in self.attributions:
          slice_name = sliced_attributions[0]
          attributions = sliced_attributions[1][output_name][sub_key]
          if metric_name:
              attributions = attributions[metric_name]
          elif len(attributions) == 1:
              attributions = list(attributions.values())[0]
          else:
              raise ValueError(
                  "metric_name must be one of the following: {}".format(
                      attributions.keys()
                  )
              )
          all_sliced_attributions[slice_name] = copy.copy(attributions)
      return all_sliced_attributions
  
imports: import copy
  from typing import Any, Dict, List, Sequence, NamedTuple, Optional, Union
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
label_desc: Use image node_id 5 for calling the EvalResult obj's underlying member method code with example usage: obj.get_attributions_for_all_slices(metric_name, output_name, class_id, k, top_k) and returns: all_sliced_attributions