code: def train_and_test(
      network,
      trainer,
      train_source,
      test_source,
      progress_printer,
      max_epochs,
      minibatch_size,
      epoch_size,
      restore,
      profiler_dir,
      testing_parameters,
  ):
      # define mapping from intput streams to network inputs
      input_map = {
          network["feature"]: train_source.streams.features,
          network["label"]: train_source.streams.labels,
      }
  
      # perform model training
      if profiler_dir:
          C.debugging.start_profiler(profiler_dir, True)
  
      for epoch in range(max_epochs):  # loop over epochs
          sample_count = 0
          while (
              sample_count < epoch_size
          ):  # loop over minibatches in the epoch
              data = train_source.next_minibatch(
                  min(minibatch_size, epoch_size - sample_count),
                  input_map=input_map,
              )  # fetch minibatch.
              trainer.train_minibatch(data)  # update model with it
              sample_count += (
                  trainer.previous_minibatch_sample_count
              )  # count samples processed so far
              progress_printer.update_with_trainer(
                  trainer, with_metric=True
              )  # log progress
          progress_printer.epoch_summary(with_metric=True)
          network["output"].save(
              os.path.join(
                  model_path, "BN-Inception_{}.model".format(epoch)
              )
          )
          C.debugging.enable_profiler()  # begin to collect profiler data after first epoch
  
      if profiler_dir:
          C.debugging.stop_profiler()
  
      # Finished
      # Evaluation parameters
      test_epoch_size, test_minibatch_size = testing_parameters
  
      # process minibatches and evaluate the model
      metric_numer = 0
      metric_denom = 0
      sample_count = 0
      minibatch_index = 0
  
      while sample_count < test_epoch_size:
          current_minibatch = min(
              test_minibatch_size, test_epoch_size - sample_count
          )
          # Fetch next test min batch.
          data = test_source.next_minibatch(
              current_minibatch, input_map=input_map
          )
          # minibatch data to be trained with
          metric_numer += (
              trainer.test_minibatch(data) * current_minibatch
          )
          metric_denom += current_minibatch
          # Keep track of the number of samples processed so far.
          sample_count += data[network["label"]].num_samples
          minibatch_index += 1
  
      print("")
      print(
          "Final Results: Minibatch[1-{}]: errs = {:0.2f}% * {}".format(
              minibatch_index + 1,
              (metric_numer * 100.0) / metric_denom,
              metric_denom,
          )
      )
      print("")
  
      return metric_numer / metric_denom
  
file_path: CNTK/Examples/Image/Classification/GoogLeNet/InceptionV3/Python/InceptionV3_ImageNet.py
imports: import os
  import math
  import argparse
  import numpy
  import cntk
  from InceptionV3 import inception_v3_norm_model
label_desc: Use image node_id 4 for calling a global function with example usage: train_and_test(network, trainer, train_source, test_source, progress_printer, max_epochs, minibatch_size, epoch_size, restore, profiler_dir, testing_parameters) and returns: unknown