code: def test_constrained_beam_scorer_finalize(self):
      inputs = self.constrained_beam_search_tester.prepare_inputs()
      self.constrained_beam_search_tester.check_constrained_beam_scorer_finalize(
          *inputs
      )
  
imports: import unittest
  from transformers import is_torch_available
  from transformers.testing_utils import require_torch, torch_device
  from ..test_modeling_common import floats_tensor, ids_tensor
label_desc: Use image node_id 4 for calling the ConstrainedBeamSearchTest obj's underlying member method code with example usage: obj.test_constrained_beam_scorer_finalize() without return types