code: def data_to_tensor(data, device="cpu", raise_error=False):
      if isinstance(data, torch.Tensor):
          if device == "cpu":
              return data.cpu()
          else:
              return data.to(device)
      if isinstance(data, (pd.DataFrame, pd.Series)):
          return data_to_tensor(
              torch.from_numpy(data.values).float(), device
          )
      elif isinstance(data, np.ndarray):
          return data_to_tensor(torch.from_numpy(data).float(), device)
      elif isinstance(data, (tuple, list)):
          return [data_to_tensor(i, device) for i in data]
      elif isinstance(data, dict):
          return {k: data_to_tensor(v, device) for k, v in data.items()}
      else:
          if raise_error:
              raise ValueError(f"Unsupported data type: {type(data)}.")
          else:
              return data
  
label_desc: Use image node_id 1 for calling a global function with example usage: data_to_tensor(data, device, raise_error) and returns: data_to_tensor, data, data, data_to_tensor, unknown, unknown, data