code: def _iter_get_targets_inputs() -> (
      Iterable[
          Tuple[
              Union[None, torch.Tensor, Collection[Union[str, int]]],
              Optional[CoreTriplesFactory],
              bool,
          ]
      ]
  ):
      """Iterate over test inputs for _get_targets."""
      factory = Nations().training
      for entity, id_to_label in (
          (True, factory.entity_id_to_label),
          (False, factory.relation_id_to_label),
      ):
          all_labels = [
              label for _, label in sorted(id_to_label.items())
          ]
          # no restriction, no factory
          yield None, None, entity, None, None, None
          # no restriction, factory
          yield None, factory, entity, all_labels, None, None
          # id restriction, no factory ...
          id_list = [0, 2, 3]
          id_tensor = torch.as_tensor(id_list, dtype=torch.long)
          yield id_list, None, entity, None, id_list, id_tensor
          yield id_tensor, None, entity, None, id_list, id_tensor
          # id restriction with factory
          labels = [all_labels[i] for i in id_list]
          yield id_list, factory, entity, labels, id_list, id_tensor
          yield id_tensor, factory, entity, labels, id_list, id_tensor
  
imports: from typing import Any, Collection, Iterable, MutableMapping, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  import pytest
  import torch
  import unittest_templates
  import pykeen.models
  import pykeen.models.mocks
  import pykeen.predict
  import pykeen.regularizers
  import pykeen.typing
  from pykeen.constants import COLUMN_LABELS
  from pykeen.datasets.nations import Nations
  from pykeen.triples.triples_factory import AnyTriples, CoreTriplesFactory, KGInfo
  from pykeen.utils import resolve_device
  from tests import cases
label_desc: Use image node_id 11 for calling a global function with example usage: _iter_get_targets_inputs() without return types