code: def _get_type_val(self, value):
      if isinstance(value, (float, np.float64)):
          value = np.float32(value)
      elif isinstance(value, bool):
          value = np.bool(value)
      elif isinstance(value, (six.integer_types, np.int64)):
          value = np.int32(value)
      elif isinstance(value, (tuple, list, np.ndarray)):
          value = np.array(value)
          if value.dtype == np.int64:
              # We use int32 by default.
              value = value.astype(np.int32)
  
          if value.dtype == np.float64:
              # We use float32 by default.
              value = value.astype(np.float32)
  
      if not isinstance(
          value, (np.generic, np.ndarray, six.string_types, bool)
      ):
          raise ValueError(
              "Unknown value for constant: {}".format(value)
          )
  
      _, builtin_type = numpy_val_to_builtin_val(value)
      return builtin_type, value
  
imports: import six
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.types.type_mapping import numpy_val_to_builtin_val, is_subtype
  import copy
  from coremltools.converters.mil.mil import Block, SYMBOL, NONE
  from coremltools.converters.mil.mil.var import Var
  from coremltools.converters.mil.mil import get_new_symbol
  from ._op_reqs import *
  import logging
label_desc: Use image node_id 4 for calling the const obj's underlying member method code with example usage: obj._get_type_val(value) and returns: builtin_type,  value