code: def test_sentencepiece(
      nlp: Tokenizer,
      text: str,
      tokens: List[str],
      spiece: "spm.SentencePieceProcessor",
  ):
      doc = nlp(text)
      assert (
          doc.text.strip()
          == text.replace("　", " ").replace("\t", " ").strip()
      )
      for token, expected in zip(doc, tokens):
          assert token.text == expected
  
      pieces_: List[str] = spiece.encode_as_pieces(text)  # type: ignore
      assert Tokenizer.get_spm_pieces(doc) == pieces_
  
file_path: camphr/packages/camphr/tests/tokenizer/sentencepiece/test_sentencepiecelang.py
imports: from pathlib import Path
  from tests.utils import check_spm
  from typing import List, TYPE_CHECKING, Tuple
  import pytest
  from camphr.tokenizer.sentencepiece import Tokenizer
label_desc: Use image node_id 2 for calling a global function with example usage: test_sentencepiece(nlp, text, tokens, spiece) without return types