code: def _generate_type_routines_input(xp, dtype, obj_type):
      dtype = numpy.dtype(dtype)
      if obj_type == "dtype":
          return dtype
      if obj_type == "specifier":
          return str(dtype)
      if obj_type == "scalar":
          return dtype.type(3)
      if obj_type == "array":
          return xp.zeros(3, dtype=dtype)
      if obj_type == "primitive":
          return type(dtype.type(3).tolist())
      assert False
  
file_path: cupy/tests/cupy_tests/test_type_routines.py
imports: import unittest
  import numpy
  import pytest
  import cupy
  from cupy import testing
label_desc: Use image node_id 1 for calling a global function with example usage: _generate_type_routines_input(xp, dtype, obj_type) and returns: dtype, str, dtype, xp, type