code: def copy(arr):
      from pgmpy import config
  
      if config.BACKEND == "numpy":
          if isinstance(arr, np.ndarray):
              return np.array(arr)
          elif isinstance(arr, (int, float)):
              return deepcopy(arr)
      else:
          return torch.clone(arr)
  
file_path: pgmpy/pgmpy/utils/compat_fns.py
imports: from copy import deepcopy
  import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: copy(arr) and returns: torch, np, deepcopy