code: def translate_constexpr(op, blob_writer):
      def get_value(var):
          if should_use_weight_file(var.val):
              value = create_file_value(var, blob_writer)
          else:
              value = create_immediate_value(var)
  
          return value
  
      output_var = op.outputs[0]
  
      attributes = {"name": create_scalar_value(op.name)}
      attributes.update({k: get_value(v) for k, v in op.inputs.items()})
  
      return pm.Operation(
          type=op.op_type,
          attributes=attributes,
          outputs=[
              pm.NamedValueType(
                  name=output_var.name,
                  type=types_to_proto(output_var.sym_type),
              )
          ],
      )
  
imports: import os
  import warnings
  from typing import Optional
  import numpy
  from coremltools import _OPSET, _SPECIFICATION_VERSION_IOS_15
  from coremltools import _logger
  from coremltools.converters.mil.backend.backend_helper import _get_probability_var_for_classifier
  from coremltools.converters.mil.backend.mil.helper import cast_to_framework_io_dtype, create_file_value, create_immediate_value, create_list_scalarvalue, create_scalar_value, types_to_proto
  from coremltools.converters.mil.backend.nn.load import _set_optional_inputs
  from coremltools.converters.mil.input_types import EnumeratedShapes, ImageType, RangeDim, TensorType
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, Program, mil_list, types
  from coremltools.converters.mil.mil.ops.registry import SSAOpRegistry
  from coremltools.converters.mil.mil.types.symbolic import any_symbolic, any_variadic, is_symbolic
  from coremltools.models.neural_network.flexible_shape_utils import NeuralNetworkImageSize, NeuralNetworkImageSizeRange, add_enumerated_image_sizes, add_multiarray_ndshape_enumeration, set_multiarray_ndshape_range, update_image_size_range
  from coremltools.models.utils import _WEIGHTS_FILE_NAME
  from coremltools.proto import FeatureTypes_pb2
  from coremltools.proto import MIL_pb2
  from coremltools.proto import Model_pb2
  from ..backend_helper import _get_colorspace_enum, _validate_image_input_output_shapes
label_desc: Use image node_id 3 for calling a global function with example usage: translate_constexpr(op, blob_writer) and returns: pm, value