code: def test_candidate_scorer():
      scorer = sockeye.beam_search.CandidateScorer(
          length_penalty_alpha=1.0,
          length_penalty_beta=0.0,
          brevity_penalty_weight=0.1,
      )
  
      raw_scores = pt.rand(5).unsqueeze(1)
      lengths = pt.tensor([1, 2, 3, 4, 5])
      reference_lengths = pt.tensor([2, 3, 4, 5, 6])
  
      scores = scorer(raw_scores, lengths, reference_lengths)
      unnormalized_scores = scorer.unnormalize(
          scores, lengths, reference_lengths
      )
      pt.testing.assert_close(unnormalized_scores, raw_scores)
  
      # int/float input
      raw_scores = 5.6
      lengths = 3
      reference_lengths = 4
  
      scores = scorer(raw_scores, lengths, reference_lengths)
      unnormalized_scores = scorer.unnormalize(
          scores, lengths, reference_lengths
      )
      assert onp.allclose(unnormalized_scores, raw_scores)
  
imports: from typing import List, Optional
  from typing import Tuple
  import numpy
  import pytest
  import torch
  import numpy
  import sockeye.beam_search
  import sockeye.constants
  import sockeye.lexicon
  import sockeye.utils
label_desc: Use image node_id 7 for calling a global function with example usage: test_candidate_scorer() without return types