code: def transform(graph):
      """core transform function for graph."""
  
      graphs = []
      for _ in range(Constant.N_NEIGHBOURS * 2):
          random_num = randrange(3)
          temp_graph = None
          if random_num == 0:
              temp_graph = to_deeper_graph(deepcopy(graph))
          elif random_num == 1:
              temp_graph = to_wider_graph(deepcopy(graph))
          elif random_num == 2:
              temp_graph = to_skip_connection_graph(deepcopy(graph))
  
          if (
              temp_graph is not None
              and temp_graph.size() <= Constant.MAX_MODEL_SIZE
          ):
              graphs.append(temp_graph)
  
          if len(graphs) >= Constant.N_NEIGHBOURS:
              break
  
      return graphs
  
file_path: nni/nni/algorithms/hpo/networkmorphism_tuner/graph_transformer.py
imports: from copy import deepcopy
  from random import randrange, sample
  from .graph import NetworkDescriptor
  from .layers import StubDense, StubReLU, get_batch_norm_class, get_conv_class, get_dropout_class, get_pooling_class, is_layer
  from .utils import Constant
label_desc: Use image node_id 6 for calling a global function with example usage: transform(graph) and returns: graphs