code: def train_and_test(
      network,
      trainer,
      train_source,
      test_source,
      minibatch_size,
      epoch_size,
      restore,
  ):
      # define mapping from intput streams to network inputs
      input_map = {
          network["feature"]: train_source.streams.features,
          network["label"]: train_source.streams.labels,
      }
  
      # Train all minibatches
      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(
              filename=os.path.join(model_path, model_name),
              restore=restore,
          ),
          test_config=TestConfig(
              minibatch_source=test_source,
              minibatch_size=minibatch_size,
          ),
      ).train()
  
file_path: CNTK/Examples/Image/Classification/VGG/Python/VGG19_ImageNet_Distributed.py
imports: from __future__ import print_function
  import os
  import math
  import argparse
  import numpy
  import cntk
  import _cntk_py
  import cntk.io.transforms
  from cntk.logging import *
  from cntk.ops import placeholder, minus, constant, relu
  from cntk.train.distributed import data_parallel_distributed_learner, Communicator
  from cntk.io import ImageDeserializer, MinibatchSource, StreamDef, StreamDefs, FULL_DATA_SWEEP
  from cntk.layers import Convolution2D, Activation, MaxPooling, Dense, Dropout, default_options, Sequential, For
  from cntk.initializer import normal
  from cntk.train.training_session import *
label_desc: Use image node_id 4 for calling a global function with example usage: train_and_test(network, trainer, train_source, test_source, minibatch_size, epoch_size, restore) without return types