code: def _get_scores(predictions_dict):
      """Returns the attention scores, sliced by source and target length."""
      prediction_len = _get_prediction_length(predictions_dict)
      source_len = predictions_dict["features.source_len"]
      return predictions_dict["attention_scores"][
          :prediction_len, :source_len
      ]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import numpy
  from matplotlib import pyplot
  import tensorflow
  from tensorflow import gfile
  from seq2seq.tasks.decode_text import _get_prediction_length
  from seq2seq.tasks.inference_task import InferenceTask, unbatch_dict
label_desc: Use image node_id 1 for calling a global function with example usage: _get_scores(predictions_dict) and returns: predictions_dict