code: def get_roundtrip_mlmodel(mlmodel):
      """
      This utility function does the following roundtrip conversion:
  
      mlprogram proto -> pymil program -> mlprogram model
      """
      pymil_prog = get_pymil_prog_from_mlmodel(mlmodel)
  
      # convert the pymil program to mlmodel
      model_spec = mlmodel.get_spec()
      roundtripped_mlmodel = mil_convert(
          pymil_prog,
          convert_to="mlprogram",
          convert_from="milinternal",
          compute_units=mlmodel.compute_unit,
          model_description=model_spec.description,
          specification_version=model_spec.specificationVersion,
      )
  
      # set MIL program attributes
      build_info = _get_metadata_from_mlmodel(mlmodel)
      roundtripped_mlmodel._set_build_info_mil_attributes(build_info)
      return roundtripped_mlmodel
  
imports: import numpy
  import pytest
  import coremltools
  from coremltools import ComputeUnit
  from coremltools._deps import _HAS_TF_2, _HAS_TORCH
  from coremltools.converters._converters_entry import _get_metadata_from_mlmodel
  from coremltools.converters.mil import Builder
  from coremltools.converters.mil.converter import mil_convert
  from coremltools.converters.mil.frontend.milproto.load import load
  from coremltools.converters.mil.frontend.tensorflow.test.test_ops import TestTensorArray
  from coremltools.converters.mil.frontend.tensorflow.test.testing_utils import run_compare_tf
  from coremltools.converters.mil.mil.ops.tests.testing_utils import compare_backend
  from coremltools.converters.mil.testing_utils import get_op_names_in_program, get_op_types_in_program
label_desc: Use image node_id 2 for calling a global function with example usage: get_roundtrip_mlmodel(mlmodel) and returns: roundtripped_mlmodel