code: def get_device_for(task):
      if (
          task in shared.cmd_opts.use_cpu
          or "all" in shared.cmd_opts.use_cpu
      ):
          return cpu
  
      return get_optimal_device()
  
imports: import sys
  import contextlib
  from functools import lru_cache
  import torch
  from modules import errors, shared
label_desc: Use image node_id 6 for calling a global function with example usage: get_device_for(task) and returns: get_optimal_device, cpu