code: def test_single_data_parallel_learner_vs_two_data_parallel_learners(
      tmpdir, device_id, mb_source
  ):
      if platform.system() == "Linux":
          pytest.skip(
              "test only runs on Windows due to mpiexec -l option"
          )
  
      launch_args = []
      launch_args += ["--outputdir", str(tmpdir)]
      launch_args += ["--mb_source", mb_source]
      launch_args += ["--trainer_type", "single"]
  
      num_workers = 1  # use a single worker.
      ret_str = mpiexec_execute(
          __file__, ["-n", str(num_workers), "-l"], launch_args
      )
      print(ret_str)
      loss_perepoch_perworker = get_loss_perepoch_perworker(
          ret_str, num_workers
      )
  
      loss_per_worker = loss_perepoch_perworker.values()
      single_learner_loss_per_worker_epochsort = []
      for epoch_losses in loss_per_worker:
          single_learner_loss_per_worker_epochsort.append(
              [epoch_losses[i] for i in sorted(epoch_losses)]
          )
  
      launch_args = []
      launch_args += ["--outputdir", str(tmpdir)]
      launch_args += ["--mb_source", mb_source]
      launch_args += ["--trainer_type", "two"]
  
      num_workers = 2  # now run in distributed workers.
      ret_str = mpiexec_execute(
          __file__, ["-n", str(num_workers), "-l"], launch_args
      )
      print(ret_str)
      loss_perepoch_perworker = get_loss_perepoch_perworker(
          ret_str, num_workers
      )
  
      loss_per_worker = loss_perepoch_perworker.values()
      multi_learner_loss_per_worker_epochsort = []
      for epoch_losses in loss_per_worker:
          multi_learner_loss_per_worker_epochsort.append(
              [epoch_losses[i] for i in sorted(epoch_losses)]
          )
  
      assert all(
          [
              single_learner_loss_per_worker_epochsort[0] == i
              for i in multi_learner_loss_per_worker_epochsort
          ]
      )
  
imports: import pytest
  import cntk
  import numpy
  import sys, os
  import argparse
  import re
  import platform
  from distributed_learner_test import mpiexec_execute
  from bmuf_metrics_aggregation_test import get_minibatch
label_desc: Use image node_id 3 for calling a global function with example usage: test_single_data_parallel_learner_vs_two_data_parallel_learners(tmpdir, device_id, mb_source) without return types