code: def load(
      model_spec, specification_version, file_weights_dir="", **kwargs
  ):
      """
      Load in-memory Proto specification of Model(.Proto) object to PyMIL
  
      Set force_spec_version to force override the spec version.
      """
      if not isinstance(model_spec, ml.Model):
          raise TypeError("Invalid Model sepc object")
  
      if specification_version < model_spec.specificationVersion:
          if not kwargs.get("force_spec_version", False):
              raise ValueError(
                  "specification_version must be greater or equal to the input model spec version"
              )
  
      if model_spec.WhichOneof("Type") != "mlProgram":
          raise ValueError(
              "Only MIL proto based mlmodels can be loaded"
          )
  
      return load_mil_proto(
          model_spec.mlProgram, specification_version, file_weights_dir
      )
  
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 14 for calling a global function with example usage: load(model_spec, specification_version, file_weights_dir) and returns: load_mil_proto