code: def set_proto_dim(proto_dim, dim):
      if isinstance(dim, (int, np.integer)):
          proto_dim.constant.size = dim
      else:
          dim_str = str(dim)
          if len(dim_str) > 0:
              if dim_str[0] == "*" or (
                  len(dim_str) >= 3 and dim_str[0:3] == "..."
              ):
                  proto_dim.unknown.variadic = True
                  return
              proto_dim.unknown.variadic = False
  
imports: import os
  import numpy
  import coremltools.proto.FeatureTypes_pb2
  import coremltools.proto.MIL_pb2
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.types import BUILTIN_TO_PROTO_TYPES, builtin_to_string, numpy_type_to_builtin_type, type_to_builtin_type
  from coremltools.converters.mil.mil.types.type_mapping import np_val_to_py_type
  from coremltools.models.utils import _WEIGHTS_DIR_NAME, _WEIGHTS_FILE_NAME
label_desc: Use image node_id 6 for calling a global function with example usage: set_proto_dim(proto_dim, dim) without return types