code: def size(arr):
      if isinstance(arr, np.ndarray):
          return arr.size
      else:
          return arr.nelement()
  
file_path: pgmpy/pgmpy/utils/compat_fns.py
imports: from copy import deepcopy
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: size(arr) and returns: arr, arr