code: def _recreate_pytorch_device(*args):
      device_map = globals().get("CHECKPOINT_DEVICE_MAP", None)
      device_object = torch.device(*args)
      mapped_object = device_object
  
      if device_map is not None:
          mapped_object = torch.device(
              device_map.get(str(device_object), str(device_object))
          )
      print("Mapping", device_object, "to", mapped_object)
      return mapped_object
  
imports: from typing import Tuple, Union
  import torch
  import dill
label_desc: Use image node_id 3 for calling a global function with example usage: _recreate_pytorch_device() and returns: mapped_object