code: def sort_replaced_module(k2o, modules):
      modules = sorted(modules, key=lambda x: k2o[x[0]])
      return modules
  
imports: import logging
  from collections import OrderedDict
  import time
  import numpy
  import torch
  import nni.retiarii.nn.pytorch
  from nni.nas.pytorch.mutables import Mutable, InputChoice, LayerChoice
label_desc: Use image node_id 8 for calling a global function with example usage: sort_replaced_module(k2o, modules) and returns: modules