code: def create_models(gpu, param, communicator):
      model = chainer.links.Linear(
          10, 10, initialW=_init_w(communicator.rank)
      )
      entire_model = [
          chainer.links.Linear(10, 10, initialW=_init_w(l))
          for l in range(communicator.size)
      ]
  
      if gpu:
          device = cupy.cuda.Device()
          model.to_device(device)
          for model_ in entire_model:
              model_.to_device(device)
  
      return (model, entire_model)
  
imports: import functools
  import chainer
  import copy
  from chainer.backends.cuda import cupy
  import chainer.testing
  import chainer.testing.attr
  import numpy
  import pytest
  import chainermn
  from chainer.functions import sigmoid
  from chainer.functions import mean_squared_error
label_desc: Use image node_id 3 for calling a global function with example usage: create_models(gpu, param, communicator) and returns: model,  entire_model