code: def test_labeled_proj_deptree(model_test, semiring, data):
      gen = Gen(model_test, data, semiring)
  
      arc_scores = torch.rand(3, 5, 5, 7)
      gen.vals = semiring.sum(arc_scores)
      count = gen.enum()[0]
      alpha = gen.struct.sum(arc_scores)
  
      assert torch.isclose(count, alpha).all()
  
      struct = gen.model(MaxSemiring)
      max_score = struct.sum(arc_scores)
      argmax = struct.marginals(arc_scores)
      assert torch.isclose(
          max_score, struct.score(arc_scores, argmax)
      ).all()
  
imports: from torch_struct import CKY, CKY_CRF, DepTree, LinearChain, SemiMarkov, Alignment, deptree_nonproj, deptree_part
  from torch_struct import LogSemiring, CheckpointSemiring, CheckpointShardSemiring, KMaxSemiring, SparseMaxSemiring, MaxSemiring, StdSemiring, EntropySemiring
  from .extensions import LinearChainTest, SemiMarkovTest, DepTreeTest, CKYTest, CKY_CRFTest, test_lookup
  import torch
  from hypothesis import given
  from hypothesis.strategies import integers, data, sampled_from
  import pytest
  from hypothesis import settings
label_desc: Use image node_id 8 for calling a global function with example usage: test_labeled_proj_deptree(model_test, semiring, data) without return types