code: def test_predict_target(
      model: pykeen.models.Model,
      head: Union[None, int, str],
      relation: Union[None, int, str],
      tail: Union[None, int, str],
      factory: Optional[CoreTriplesFactory],
      targets: Union[None, torch.LongTensor, Sequence[Union[int, str]]],
  ):
      """Test target scoring."""
      pred = pykeen.predict.predict_target(
          model=model,
          head=head,
          relation=relation,
          tail=tail,
          triples_factory=factory,
          targets=targets,
      )
      assert isinstance(pred, pykeen.predict.TargetPredictions)
      assert pred.factory == factory
  
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 14 for calling a global function with example usage: test_predict_target(model, head, relation, tail, factory, targets) without return types