code: def get_const_mode(val):
      # Heuristics to determine if a val should be file value or immediate
      # value.
      if isinstance(val, six.string_types):
          return "immediate_value"
      if isinstance(val, (np.generic, np.ndarray)):
          if val.size > 10:
              return "file_value"
          return "immediate_value"
      raise ValueError("val {} not recognized.".format(val))
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/const_elimination.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  import six
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 1 for calling a global function with example usage: get_const_mode(val) and returns: str, str, str