code: def make_ground_truth(
      label_num, shape, ignore_label, has_ignore_label, dtype
  ):
      if (ignore_label == -1) != (has_ignore_label):  # xor
          lower = 0
      elif ignore_label == 0 and not has_ignore_label:
          lower = 1
      else:
          lower = -1
  
      t = numpy.random.randint(lower, label_num, shape)
      return t.astype(dtype)
  
file_path: chainer/tests/chainer_tests/functions_tests/evaluation_tests/test_classification_summary.py
imports: import unittest
  import numpy
  import chainer
  from chainer.backends import cuda
  from chainer import functions
  from chainer import testing
  from chainer.testing import attr
label_desc: Use image node_id 5 for calling a global function with example usage: make_ground_truth(label_num, shape, ignore_label, has_ignore_label, dtype) and returns: t