code: def convert_data_type(im_type, d, keys=("img", "image", "label")):
      out = deepcopy(d)
      for k, v in out.items():
          if k in keys and isinstance(v, np.ndarray):
              out[k] = im_type(v)
      return out
  
file_path: MONAI/tests/test_rand_crop_by_pos_neg_label.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  from parameterized import parameterized
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import RandCropByPosNegLabel
  from monai.transforms.lazy.functional import apply_pending
  from tests.utils import TEST_NDARRAYS_ALL, assert_allclose
label_desc: Use image node_id 1 for calling the TestRandCropByPosNegLabel obj's underlying member method code with example usage: obj.convert_data_type(im_type, d, keys) and returns: out