code: def hyp_score(log_probs, sequence_lengths, config):
      """Calculates scores for beam search hypotheses."""
  
      # Calculate the length penality
      length_penality_ = length_penalty(
          sequence_lengths=sequence_lengths,
          penalty_factor=config.length_penalty_weight,
      )
  
      score = log_probs / length_penality_
      return score
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from collections import namedtuple
  import numpy
  import tensorflow
  from tensorflow.python.util import nest
label_desc: Use image node_id 5 for calling a global function with example usage: hyp_score(log_probs, sequence_lengths, config) and returns: score