code: def test_masakhane_corpus(tasks_base_path):
      # This test covers the complete MasakhaNER dataset, including support for v1 and v2.
      supported_versions = ["v1", "v2"]
  
      supported_languages = {
          "v1": [
              "amh",
              "hau",
              "ibo",
              "kin",
              "lug",
              "luo",
              "pcm",
              "swa",
              "wol",
              "yor",
          ],
          "v2": [
              "bam",
              "bbj",
              "ewe",
              "fon",
              "hau",
              "ibo",
              "kin",
              "lug",
              "mos",
              "pcm",
              "nya",
              "sna",
              "swa",
              "tsn",
              "twi",
              "wol",
              "xho",
              "yor",
              "zul",
          ],
      }
  
      masakhane_stats = {
          "v1": {
              "amh": {"train": 1750, "dev": 250, "test": 500},
              "hau": {"train": 1912, "dev": 276, "test": 552},
              "ibo": {"train": 2235, "dev": 320, "test": 638},
              "kin": {
                  "train": 2116,
                  "dev": 302,
                  "test": 605,
              },
              "lug": {"train": 1428, "dev": 200, "test": 407},
              "luo": {"train": 644, "dev": 92, "test": 186},
              "pcm": {"train": 2124, "dev": 306, "test": 600},
              "swa": {"train": 2109, "dev": 300, "test": 604},
              "wol": {"train": 1871, "dev": 267, "test": 539},
              "yor": {"train": 2171, "dev": 305, "test": 645},
          },
          "v2": {
              "bam": {"train": 4462, "dev": 638, "test": 1274},
              "bbj": {"train": 3384, "dev": 483, "test": 966},
              "ewe": {"train": 3505, "dev": 501, "test": 1001},
              "fon": {"train": 4343, "dev": 623, "test": 1228},
              "hau": {"train": 5716, "dev": 816, "test": 1633},
              "ibo": {"train": 7634, "dev": 1090, "test": 2181},
              "kin": {"train": 7825, "dev": 1118, "test": 2235},
              "lug": {"train": 4942, "dev": 706, "test": 1412},
              "mos": {"train": 4532, "dev": 648, "test": 1294},
              "pcm": {"train": 5646, "dev": 806, "test": 1613},
              "nya": {"train": 6250, "dev": 893, "test": 1785},
              "sna": {"train": 6207, "dev": 887, "test": 1773},
              "swa": {"train": 6593, "dev": 942, "test": 1883},
              "tsn": {"train": 3489, "dev": 499, "test": 996},
              "twi": {"train": 4240, "dev": 605, "test": 1211},
              "wol": {"train": 4593, "dev": 656, "test": 1312},
              "xho": {"train": 5718, "dev": 817, "test": 1633},
              "yor": {"train": 6876, "dev": 983, "test": 1964},
              "zul": {"train": 5848, "dev": 836, "test": 1670},
          },
      }
  
      def check_number_sentences(
          reference: int,
          actual: int,
          split_name: str,
          language: str,
          version: str,
      ):
          assert (
              actual == reference
          ), f"Mismatch in number of sentences for {language}@{version}/{split_name}"
  
      for version in supported_versions:
          for language in supported_languages[version]:
              corpus = flair.datasets.NER_MASAKHANE(
                  languages=language, version=version
              )
  
              gold_stats = masakhane_stats[version][language]
  
              check_number_sentences(
                  len(corpus.train),
                  gold_stats["train"],
                  "train",
                  language,
                  version,
              )
              check_number_sentences(
                  len(corpus.dev),
                  gold_stats["dev"],
                  "dev",
                  language,
                  version,
              )
              check_number_sentences(
                  len(corpus.test),
                  gold_stats["test"],
                  "test",
                  language,
                  version,
              )
  
imports: import copy
  import shutil
  import pytest
  import flair
  import flair.datasets
  from flair.data import MultiCorpus, Sentence
  from flair.datasets import ColumnCorpus
  from flair.datasets.sequence_labeling import ONTONOTES, JsonlCorpus, JsonlDataset, MultiFileJsonlCorpus
label_desc: Use image node_id 26 for calling a global function with example usage: test_masakhane_corpus(tasks_base_path) without return types