code: def run_test_targets(self, model, tokenizer):
      vocab = tokenizer.get_vocab()
      targets = list(sorted(vocab.keys()))[:2]
      # Pipeline argument
      fill_masker = FillMaskPipeline(
          model=model, tokenizer=tokenizer, targets=targets
      )
      outputs = fill_masker(f"This is a {tokenizer.mask_token}")
      self.assertEqual(
          outputs,
          [
              {
                  "sequence": ANY(str),
                  "score": ANY(float),
                  "token": ANY(int),
                  "token_str": ANY(str),
              },
              {
                  "sequence": ANY(str),
                  "score": ANY(float),
                  "token": ANY(int),
                  "token_str": ANY(str),
              },
          ],
      )
      target_ids = {vocab[el] for el in targets}
      self.assertEqual(set(el["token"] for el in outputs), target_ids)
      self.assertEqual(
          set(el["token_str"] for el in outputs), set(targets)
      )
  
      # Call argument
      fill_masker = FillMaskPipeline(model=model, tokenizer=tokenizer)
      outputs = fill_masker(
          f"This is a {tokenizer.mask_token}", targets=targets
      )
      self.assertEqual(
          outputs,
          [
              {
                  "sequence": ANY(str),
                  "score": ANY(float),
                  "token": ANY(int),
                  "token_str": ANY(str),
              },
              {
                  "sequence": ANY(str),
                  "score": ANY(float),
                  "token": ANY(int),
                  "token_str": ANY(str),
              },
          ],
      )
      target_ids = {vocab[el] for el in targets}
      self.assertEqual(set(el["token"] for el in outputs), target_ids)
      self.assertEqual(
          set(el["token_str"] for el in outputs), set(targets)
      )
  
      # Score equivalence
      outputs = fill_masker(
          f"This is a {tokenizer.mask_token}", targets=targets
      )
      tokens = [top_mask["token_str"] for top_mask in outputs]
      scores = [top_mask["score"] for top_mask in outputs]
  
      unmasked_targets = fill_masker(
          f"This is a {tokenizer.mask_token}", targets=tokens
      )
      target_scores = [
          top_mask["score"] for top_mask in unmasked_targets
      ]
      self.assertEqual(
          nested_simplify(scores), nested_simplify(target_scores)
      )
  
      # Raises with invalid
      with self.assertRaises(ValueError):
          outputs = fill_masker(
              f"This is a {tokenizer.mask_token}", targets=[""]
          )
      with self.assertRaises(ValueError):
          outputs = fill_masker(
              f"This is a {tokenizer.mask_token}", targets=[]
          )
      with self.assertRaises(ValueError):
          outputs = fill_masker(
              f"This is a {tokenizer.mask_token}", targets=""
          )
  
imports: import unittest
  from transformers import MODEL_FOR_MASKED_LM_MAPPING, TF_MODEL_FOR_MASKED_LM_MAPPING, FillMaskPipeline, pipeline
  from transformers.pipelines import PipelineException
  from transformers.testing_utils import nested_simplify, require_tf, require_torch, require_torch_gpu, slow
  from .test_pipelines_common import ANY, PipelineTestCaseMeta
label_desc: Use image node_id 11 for calling the FillMaskPipelineTests obj's underlying member method code with example usage: obj.run_test_targets(model, tokenizer) without return types