code: def all_to_cuda(data, device=None):
      if isinstance(data, torch.Tensor) or isinstance(data, GraphData):
          data = to_cuda(data, device)
      elif isinstance(data, (list, dict)):
          keys = (
              range(len(data))
              if isinstance(data, list)
              else data.keys()
          )
          for k in keys:
              if isinstance(data[k], torch.Tensor) or isinstance(
                  data[k], GraphData
              ):
                  data[k] = to_cuda(data[k], device)
      return data
  
imports: import os
  import pickle
  from collections import OrderedDict
  import numpy
  import torch
  import torch.nn
  import yaml
  from scipy import sparse
  from sklearn import preprocessing
  from graph4nlp.pytorch.data.data import GraphData
label_desc: Use image node_id 5 for calling a global function with example usage: all_to_cuda(data, device) and returns: data