code: def _check_var_scalar_value_in_interval(x, lower_bound, upper_bound):
      """
      :param x: var
      :param lower_bound: a scalar value
      :param upper_bound: a scalar value
      :return: True if the value of var is in the interval [lower_bound, upper_bound]
      """
      if x.val is None:
          return False
      if not isinstance(x.val, (np.ndarray, np.generic)):
          return False
  
      if isinstance(x.val, np.ndarray):
          if x.val.size != 1:
              return False
          x_val = x.val[:][0] if len(x.val.shape) > 0 else x.val[()]
      else:
          x_val = x.val
  
      if x_val >= lower_bound and x_val <= upper_bound:
          return True
      return False
  
file_path: coremltools/coremltools/converters/mil/mil/passes/helper.py
imports: from typing import List
  import numpy
  from coremltools.converters.mil.mil import Block, Operation
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
label_desc: Use image node_id 4 for calling a global function with example usage: _check_var_scalar_value_in_interval(x, lower_bound, upper_bound) and returns: False, False, False, True, False