code: def run(num_workers):
      """Distributed Synchronous SGD Example"""
      th.manual_seed(1234)
      train_set, bsz = partition_dataset(num_workers)
      model = Net()
      optimizer = optim.SGD(model.parameters(), lr=0.01, momentum=0.5)
  
      num_batches = ceil(len(train_set.dataset) / float(bsz))
  
      from random import randint
  
      param = {
          "worker_{}_stuff".format(dist.get_rank()): "some stuff "
          + str(randint(0, 100))
      }
      Task.current_task().connect(param)
      Task.current_task().upload_artifact(
          "temp {:02d}".format(dist.get_rank()),
          artifact_object={"worker_rank": dist.get_rank()},
      )
  
      for epoch in range(2):
          epoch_loss = 0.0
          for i, (data, target) in enumerate(train_set):
              optimizer.zero_grad()
              output = model(data)
              loss = F.nll_loss(output, target)
              epoch_loss += loss.item()
              loss.backward()
              average_gradients(model)
              optimizer.step()
              if i % 10 == 0:
                  print(
                      "{}] Train Epoch {} - {} \tLoss  {:.6f}".format(
                          dist.get_rank(), epoch, i, loss
                      )
                  )
                  Task.current_task().get_logger().report_scalar(
                      "loss",
                      "worker {:02d}".format(dist.get_rank()),
                      value=loss.item(),
                      iteration=i,
                  )
              if i > 100:
                  break
          print(
              "Rank ",
              dist.get_rank(),
              ", epoch ",
              epoch,
              ": ",
              epoch_loss / num_batches,
          )
  
imports: import os
  import subprocess
  import sys
  from argparse import ArgumentParser
  from datetime import timedelta
  from math import ceil
  from random import Random
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  from torch import optim
  from torchvision import datasets, transforms
  from clearml import Task
label_desc: Use image node_id 2 for calling a global function with example usage: run(num_workers) without return types