code: def _ForEachDevice(
      devices,
      f,
      device_type,
      device_prefix,
      scoped=False,
      *args,
      **kwargs,
  ):
      for device in devices:
          device_opt = core.DeviceOption(device_type, device)
          with core.DeviceScope(device_opt):
              if scoped:
                  with core.NameScope(
                      "{}_{}".format(device_prefix, device)
                  ):
                      f(device, *args, **kwargs)
              else:
                  f(device, *args, **kwargs)
  
imports: from collections import OrderedDict
  import logging
  import copy
  from multiprocessing import cpu_count
  from caffe2.python import model_helper, dyndep, scope, workspace, core, memonger, utils
  from caffe2.proto import caffe2_pb2
  import numpy
  import warnings
label_desc: Use image node_id 16 for calling a global function with example usage: _ForEachDevice(devices, f, device_type, device_prefix, scoped) without return types