code: def _get_metadata_from_mlmodel(mlmodel):
      # Copy from source mlmodel if metadata info exists
      src_pkg_version = mlmodel.user_defined_metadata[_METADATA_SOURCE]
      coremltools_version = mlmodel.user_defined_metadata[
          _METADATA_VERSION
      ]
  
      src_dialect = (
          None
          if _METADATA_SOURCE_DIALECT
          not in mlmodel.user_defined_metadata
          else mlmodel.user_defined_metadata[_METADATA_SOURCE_DIALECT]
      )
  
      src_pkg_version_list = src_pkg_version.split("==")
      if len(src_pkg_version_list) == 0:
          src_pkg, pkg_ver = None, None
      elif len(src_pkg_version_list) == 1:
          src_pkg, pkg_ver = src_pkg_version_list[0], ""
      elif len(src_pkg_version_list) == 2:
          src_pkg, pkg_ver = src_pkg_version_list
      else:
          raise AssertionError("Unable to parse src_pkg_version")
  
      build_info = {
          "coremltools-version": _ct_version
          if not coremltools_version
          else coremltools_version
      }
      if src_pkg is not None and pkg_ver is not None:
          build_info["coremltools-component-" + src_pkg] = str(pkg_ver)
  
      if src_dialect is not None:
          build_info["coremltools-source-dialect"] = src_dialect
  
      return build_info
  
imports: import collections
  import gc
  import os
  from typing import List, Optional, Text, Union
  from coremltools import _LOWEST_ALLOWED_SPECIFICATION_VERSION_FOR_MILPROGRAM, _LOWEST_ALLOWED_SPECIFICATION_VERSION_FOR_NEURALNETWORK
  from coremltools import ComputeUnit
  from coremltools import __version__
  from coremltools import _logger
  from coremltools._deps import _HAS_TF_1, _HAS_TF_2, _HAS_TORCH, _HAS_TORCH_EXPORT_API
  from coremltools.converters._profile_utils import _profile
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget, check_deployment_compatibility
  from coremltools.converters.mil.converter import mil_convert
  from coremltools.converters.mil.input_types import ClassifierConfig, EnumeratedShapes, ImageType, InputType, RangeDim, Shape, TensorType
  from coremltools.converters.mil.mil import Program, types
  from coremltools.converters.mil.mil.passes.defs.quantization import ComputePrecision
  from coremltools.converters.mil.mil.passes.defs.quantization import FP16ComputePrecision
  from coremltools.converters.mil.mil.passes.graph_pass import PassOption
  from coremltools.converters.mil.mil.passes.pass_pipeline import PassPipeline
  from coremltools.models import _METADATA_SOURCE, _METADATA_SOURCE_DIALECT, _METADATA_VERSION
  from coremltools.models.utils import _MLPACKAGE_EXTENSION
label_desc: Use image node_id 10 for calling a global function with example usage: _get_metadata_from_mlmodel(mlmodel) and returns: build_info