code: def test_las_per_type(en_vocab):
      # Gold and Doc are identical
      scorer = Scorer()
      examples = []
      for input_, annot in test_las_apple:
          doc = Doc(
              en_vocab,
              words=input_.split(" "),
              heads=annot["heads"],
              deps=annot["deps"],
          )
          gold = {"heads": annot["heads"], "deps": annot["deps"]}
          example = Example.from_dict(doc, gold)
          examples.append(example)
      results = scorer.score(examples)
  
      assert results["dep_uas"] == 1.0
      assert results["dep_las"] == 1.0
      assert results["dep_las_per_type"]["nsubj"]["p"] == 1.0
      assert results["dep_las_per_type"]["nsubj"]["r"] == 1.0
      assert results["dep_las_per_type"]["nsubj"]["f"] == 1.0
      assert results["dep_las_per_type"]["compound"]["p"] == 1.0
      assert results["dep_las_per_type"]["compound"]["r"] == 1.0
      assert results["dep_las_per_type"]["compound"]["f"] == 1.0
  
      # One dep is incorrect in Doc
      scorer = Scorer()
      examples = []
      for input_, annot in test_las_apple:
          doc = Doc(
              en_vocab,
              words=input_.split(" "),
              heads=annot["heads"],
              deps=annot["deps"],
          )
          gold = {"heads": annot["heads"], "deps": annot["deps"]}
          doc[0].dep_ = "compound"
          example = Example.from_dict(doc, gold)
          examples.append(example)
      results = scorer.score(examples)
  
      assert results["dep_uas"] == 1.0
      assert_almost_equal(results["dep_las"], 0.9090909)
      assert results["dep_las_per_type"]["nsubj"]["p"] == 0
      assert results["dep_las_per_type"]["nsubj"]["r"] == 0
      assert results["dep_las_per_type"]["nsubj"]["f"] == 0
      assert_almost_equal(
          results["dep_las_per_type"]["compound"]["p"], 0.666666666
      )
      assert results["dep_las_per_type"]["compound"]["r"] == 1.0
      assert results["dep_las_per_type"]["compound"]["f"] == 0.8
  
file_path: spacy/spacy/tests/test_scorer.py
imports: import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal
  from pytest import approx
  from spacy.lang.en import English
  from spacy.scorer import PRFScore, ROCAUCScore, Scorer, _roc_auc_score, _roc_curve
  from spacy.tokens import Doc, Span
  from spacy.training import Example
  from spacy.training.iob_utils import offsets_to_biluo_tags
label_desc: Use image node_id 5 for calling a global function with example usage: test_las_per_type(en_vocab) without return types