code: def old_to_new_architecture(old_architecture):
      """Convert architectures defined by block_types only.
  
      These architectures are more restricted -- they always have one input layer
      and one logits layer, and all blocks are only connected to the previous one or
      two blocks.
  
      Args:
        old_architecture: List of block_type ints.
  
      Returns:
        Architecture.
      """
  
      node_list = []
      for block_type in old_architecture:
          block_type_name = block_builder.BlockType(block_type).name
          if ("NASNET" in block_type_name) or (
              "AMOEBA" in block_type_name
          ):
              input_indices = [-2, -1]
          else:
              input_indices = [-1]
          node_list.append(
              Node(
                  block_type,
                  input_indices=input_indices,
                  combiner_type=CombinerType.CONCAT,
              )
          )
      return Architecture(node_list)
  
imports: import abc
  import collections
  import enum
  import time
  from absl import logging
  from model_search import block_builder
  from model_search import utils
  from model_search.architecture import architecture_utils
  from model_search.proto import phoenix_spec_pb2
  import tensorflow.compat.v2
label_desc: Use image node_id 4 for calling a global function with example usage: old_to_new_architecture(old_architecture) and returns: Architecture