code: def test_convert_data_type(self, in_image, im_out, out_dtype, safe):
      converted_im, orig_type, orig_device = convert_data_type(
          in_image, type(im_out), dtype=out_dtype, safe=safe
      )
      # check input is unchanged
      self.assertEqual(type(in_image), orig_type)
      if isinstance(in_image, torch.Tensor):
          self.assertEqual(in_image.device, orig_device)
      # check output is desired type
      self.assertEqual(type(converted_im), type(im_out))
      # check data has been clipped
      assert_allclose(converted_im, im_out)
      # check dtype is unchanged
      if out_dtype is None:
          if isinstance(in_image, (np.ndarray, torch.Tensor)):
              self.assertEqual(converted_im.dtype, im_out.dtype)
  
file_path: MONAI/tests/test_convert_data_type.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data import MetaTensor
  from monai.utils.type_conversion import convert_data_type, convert_to_dst_type, get_equivalent_dtype
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose
label_desc: Use image node_id 1 for calling the TestConvertDataType obj's underlying member method code with example usage: obj.test_convert_data_type(in_image, im_out, out_dtype, safe) without return types