code: def load_mil_proto(
      program_spec, specification_version, file_weights_dir=""
  ):
      """
      Load in-memory Proto specification of MILSpec.Program(.Proto) object to PyMIL
      """
      if not isinstance(program_spec, pm.Program):
          raise TypeError("Invalid Program spec object")
  
      if program_spec.docString:
          raise NotImplementedError(
              "Docstring would be lost in the process"
          )
  
      if program_spec.version != 1:
          raise ValueError("Invalid program version")
  
      context = TranscriptionContext(file_weights_dir)
      pymil_program = Program()
      for func_name, func_spec in program_spec.functions.items():
          pymil_program.add_function(
              func_name,
              _load_function(context, func_spec, specification_version),
          )
  
      for attr_name, attr_spec in program_spec.attributes.items():
          if attr_name not in ("buildInfo",):
              raise ValueError("Invalid attribute for program")
  
      return pymil_program
  
imports: import os
  import numpy
  from coremltools import _logger
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.backend.mil import helper
  from coremltools.converters.mil.mil import Block
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, ListVar, Placeholder, Program, TupleInputType, Var, mil_list, types
  from coremltools.converters.mil.mil.block import curr_block
  from coremltools.converters.mil.mil.ops.registry import SSAOpRegistry
  from coremltools.proto import MIL_pb2
  from coremltools.proto import Model_pb2
  from .helper import proto_to_types
label_desc: Use image node_id 13 for calling a global function with example usage: load_mil_proto(program_spec, specification_version, file_weights_dir) and returns: pymil_program