def is_equal(var, val):
 try:
  v = get_scalar_constant_value(var)
  return (v == val)
 except NotScalarConstantError:
  return False

def is_equal ( var , val ) : try : v = get_scalar_constant_value ( var ) return ( v == val ) except NotScalarConstantError : return False
returns true if var is always equal to val .