code: def test_copy_or_convert_data(data_fmt, save_fmt, is_feature):
      with tempfile.TemporaryDirectory() as test_dir:
          data = np.arange(10)
          tensor_data = torch.from_numpy(data)
          in_type_name = "npy" if data_fmt == "numpy" else "pt"
          input_path = os.path.join(test_dir, f"data.{in_type_name}")
          out_type_name = "npy" if save_fmt == "numpy" else "pt"
          output_path = os.path.join(
              test_dir, f"out_data.{out_type_name}"
          )
          if data_fmt == "numpy":
              np.save(input_path, data)
          else:
              torch.save(tensor_data, input_path)
          if save_fmt == "torch":
              with pytest.raises(AssertionError):
                  internal.copy_or_convert_data(
                      input_path,
                      output_path,
                      data_fmt,
                      save_fmt,
                      is_feature=is_feature,
                  )
          else:
              internal.copy_or_convert_data(
                  input_path,
                  output_path,
                  data_fmt,
                  save_fmt,
                  is_feature=is_feature,
              )
          if is_feature:
              data = data.reshape(-1, 1)
              tensor_data = tensor_data.reshape(-1, 1)
          if save_fmt == "numpy":
              out_data = np.load(output_path)
              assert (data == out_data).all()
  
          data = None
          tensor_data = None
          out_data = None
  
file_path: dgl/tests/python/pytorch/graphbolt/utils/test_internal.py
imports: import json
  import os
  import re
  import tempfile
  import dgl.graphbolt.internal
  import numpy
  import pandas
  import pytest
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: test_copy_or_convert_data(data_fmt, save_fmt, is_feature) without return types