code: def cpu_gpu(fn):
      def helper(self):
          fn(self, "cpu")
          if torch.cuda.is_available():
              fn(self, "gpu")
  
      return helper
  
imports: import functools
  import unittest
  from typing import Any, Dict, Sequence
  import fairseq
  import fairseq.options
  import fairseq.tasks
  import torch
  from tests.utils import dummy_dictionary
label_desc: Use image node_id 3 for calling a global function with example usage: cpu_gpu(fn) and returns: helper