code: def get_loss_perepoch_perworker(log_line, num_workers):
      # [0]Finished Epoch[1]: [Training] loss = 1.663636 * 10, metric = 52.40% * 10 0.890s ( 11.2 samples/s);
      regex_pattern = r"\[(?P<worker_rank>\d)\].*? Epoch\[(?P<epoch>\d+)\].*? loss = (?P<loss>\d+\.\d+) \* (?P<samples>\d+).*? metric = (?P<metric>\d+\.\d+)"
      loss_perepoch_perworker = {i: {} for i in range(num_workers)}
      for match in re.finditer(regex_pattern, log_line):
          rank = int(match.groupdict()["worker_rank"])
          epoch = int(match.groupdict()["epoch"])
          loss = match.groupdict()["loss"]
          metric = match.groupdict()["metric"]
          samples = int(match.groupdict()["samples"])
          loss_perepoch_perworker[rank].update(
              {epoch: (loss, metric, samples)}
          )
      return loss_perepoch_perworker
  
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 2 for calling a global function with example usage: get_loss_perepoch_perworker(log_line, num_workers) and returns: loss_perepoch_perworker