code: def test_unlabeled_accuracy_ignores_incorrect_labels(
      self, device: str
  ):
      self._send_tensors_to_device(device)
  
      label_predictions = self.label_predictions
      # Change some stuff so our 4 of our label predictions are wrong.
      label_predictions[0, 3:] = 3
      label_predictions[1, 0] = 7
      self.scorer(
          self.predictions,
          label_predictions,
          self.gold_indices,
          self.gold_labels,
          self.mask,
      )
  
      metrics = self.scorer.get_metric()
  
      assert metrics["UAS"] == 1.0
      assert metrics["UEM"] == 1.0
  
      # 4 / 12 labels were wrong and 2 positions
      # are masked, so 6/10 = 0.6 LAS.
      assert metrics["LAS"] == 0.6
      # Neither should have labeled exact match.
      assert metrics["LEM"] == 0.0
  
file_path: allennlp/tests/training/metrics/attachment_scores_test.py
imports: from typing import Any, Dict, List, Tuple, Union
  import torch
  from allennlp.common.testing import AllenNlpTestCase, multi_device, run_distributed_test, global_distributed_metric
  from allennlp.training.metrics import AttachmentScores
label_desc: Use image node_id 4 for calling the AttachmentScoresTest obj's underlying member method code with example usage: obj.test_unlabeled_accuracy_ignores_incorrect_labels(device) without return types