code: def train_and_test(
      network,
      trainer,
      train_source,
      test_source,
      max_epochs,
      minibatch_size,
      epoch_size,
      restore,
      profiling,
  ):
      # define mapping from intput streams to network inputs
      input_map = {
          network["feature"]: train_source.streams.features,
          network["label"]: train_source.streams.labels,
      }
  
      if profiling:
          start_profiler(sync_gpu=True)
  
      training_session(
          trainer=trainer,
          mb_source=train_source,
          model_inputs_to_streams=input_map,
          mb_size=minibatch_size,
          progress_frequency=epoch_size,
          checkpoint_config=CheckpointConfig(
              frequency=epoch_size,
              filename=os.path.join(model_path, "BN-Inception_CIFAR10"),
              restore=restore,
          ),
          test_config=TestConfig(
              test_source, minibatch_size=minibatch_size
          ),
      ).train()
  
      if profiling:
          stop_profiler()
  
file_path: CNTK/Examples/Image/Classification/GoogLeNet/BN-Inception/Python/BN_Inception_CIFAR10_Distributed.py
imports: from __future__ import print_function
  from __future__ import division
  import os
  import math
  import argparse
  import numpy
  import cntk
  import _cntk_py
  import cntk.io.transforms
  from cntk.debugging import start_profiler, stop_profiler
  from cntk.learners import learning_parameter_schedule, momentum_schedule, momentum_sgd
  from cntk.logging import ProgressPrinter, log_number_of_parameters
  from cntk.ops import input
  from cntk.io import ImageDeserializer, MinibatchSource, StreamDef, StreamDefs, FULL_DATA_SWEEP
  from cntk.train.distributed import data_parallel_distributed_learner, Communicator
  from cntk.train import training_session, CheckpointConfig, TestConfig, Trainer
  from BN_Inception_CIFAR10 import create_image_mb_source, create_bn_inception
label_desc: Use image node_id 2 for calling a global function with example usage: train_and_test(network, trainer, train_source, test_source, max_epochs, minibatch_size, epoch_size, restore, profiling) without return types