code: def get_device():
      global device_cache
      if device_cache is None:
          device_cache = (
              torch.device("cuda")
              if torch.cuda.is_available()
              else torch.device("cpu")
          )
      return device_cache
  
file_path: deepsnap/examples/subgraph_matching/utils.py
imports: from collections import defaultdict
  from deepsnap.batch import Batch
  from deepsnap.dataset import GraphDataset
  import torch
  import torch.optim
  import torch_geometric.utils
  from torch_geometric.data import DataLoader
  import networkx
label_desc: Use image node_id 1 for calling a global function with example usage: get_device() and returns: device_cache