code: def clone_model(
      base_model, from_node_names, to_node_names, clone_method
  ):
      from_nodes = [
          find_by_name(base_model, node_name)
          for node_name in from_node_names
      ]
      if None in from_nodes:
          print(
              "Error: could not find all specified 'from_nodes' in clone. Looking for {}, found {}".format(
                  from_node_names, from_nodes
              )
          )
      to_nodes = [
          find_by_name(base_model, node_name)
          for node_name in to_node_names
      ]
      if None in to_nodes:
          print(
              "Error: could not find all specified 'to_nodes' in clone. Looking for {}, found {}".format(
                  to_node_names, to_nodes
              )
          )
      input_placeholders = dict(
          zip(from_nodes, [placeholder() for x in from_nodes])
      )
      cloned_net = combine(to_nodes).clone(
          clone_method, input_placeholders
      )
      return cloned_net
  
imports: from __future__ import print_function
  import numpy
  import os, sys
  import argparse
  import easydict
  import cntk
  from cntk import Trainer, load_model, Axis, input_variable, parameter, times, combine, softmax, roipooling, plus, element_times, CloneMethod, alias, Communicator, reduce_sum
  from cntk.core import Value
  from cntk.initializer import normal
  from cntk.layers import placeholder, Constant, Sequential
  from cntk.learners import momentum_sgd, learning_parameter_schedule_per_sample, momentum_schedule
  from cntk.logging import log_number_of_parameters, ProgressPrinter
  from cntk.logging.graph import find_by_name, plot
  from cntk.losses import cross_entropy_with_softmax
  from cntk.metrics import classification_error
  from _cntk_py import force_deterministic_algorithms
  from utils.rpn.cntk_smoothL1_loss import SmoothL1Loss
  from utils.annotations.annotations_helper import parse_class_map_file
  from utils.od_mb_source import ObjectDetectionMinibatchSource
  from utils.proposal_helpers import ProposalProvider
label_desc: Use image node_id 3 for calling a global function with example usage: clone_model(base_model, from_node_names, to_node_names, clone_method) and returns: cloned_net