code: def parse_results(results, n_nodes):
      concat = range(2, 2 + n_nodes)
      normal_gene = []
      reduction_gene = []
      for i in range(n_nodes):
          normal_node = []
          reduction_node = []
          for j in range(2 + i):
              normal_key = "normal_n{}_p{}".format(i + 2, j)
              reduction_key = "reduce_n{}_p{}".format(i + 2, j)
              normal_op = results[normal_key].cpu().numpy()
              reduction_op = results[reduction_key].cpu().numpy()
              if sum(normal_op == 1):
                  normal_index = np.argmax(normal_op)
                  normal_node.append((PRIMITIVES[normal_index], j))
              if sum(reduction_op == 1):
                  reduction_index = np.argmax(reduction_op)
                  reduction_node.append(
                      (PRIMITIVES[reduction_index], j)
                  )
          normal_gene.append(normal_node)
          reduction_gene.append(reduction_node)
  
      genotypes = Genotype(
          normal=normal_gene,
          normal_concat=concat,
          reduce=reduction_gene,
          reduce_concat=concat,
      )
      return genotypes
  
imports: import json
  import logging
  import os
  import random
  from collections import namedtuple
  import numpy
  import torch
  import torch.distributed
  import torch.nn
  from genotypes import Genotype
  from ops import PRIMITIVES
  from nni.algorithms.nas.pytorch.cdarts.utils import *
label_desc: Use image node_id 2 for calling a global function with example usage: parse_results(results, n_nodes) and returns: genotypes