Checks whether two scalar values (as determined by isScalar()) are equal.

@method scalarEquals
@static
@param {Mixed} a1 - First value
@param {Mixed} a2 - Second value
@return {Boolean}
542216
function scalarEquals(a1, a2) {
	if (a1 instanceof Date && a2 instanceof Date) return (a1.getTime() === a2.getTime());
	return a1 === a2;
}
323197
public static boolean shapeEquals(int[] shape1, int[] shape2) {
        if (isColumnVectorShape(shape1) && isColumnVectorShape(shape2)) {
            return Arrays.equals(shape1, shape2);
        }

        if (isRowVectorShape(shape1) && isRowVectorShape(shape2)) {
            int[] shape1Comp = squeeze(shape1);
            int[] shape2Comp = squeeze(shape2);
            return Arrays.equals(shape1Comp, shape2Comp);
        }

        //scalars
        if(shape1.length == 0 || shape2.length == 0) {
            if(shape1.length == 0 && shapeIsScalar(shape2)) {
                return true;
            }

            if(shape2.length == 0 && shapeIsScalar(shape1)) {
                return true;
            }
        }


        shape1 = squeeze(shape1);
        shape2 = squeeze(shape2);

        return scalarEquals(shape1, shape2) || Arrays.equals(shape1, shape2);
    }
682883
function scalar_eq(a,b,precision){
    precision = precision || 0;
    return Math.abs(a-b) <= precision;
}
261135
public static boolean equalsValue(final BigDecimal bd1, final BigDecimal bd2) {
        if (bd1 == null) {
            return bd2 == null;
        }
        return BigDecimalUtil.isSameValue(bd1, bd2);
    }
1348224
function equal(a, b, diff) {
  diff = diff || {};
  if (a.type !== b.type) {
    return equalDiff(a, b, diff);
  }
  if (a.value !== b.value) {
    return equalDiff(a, b, diff);
  }
  if (isValueNode(a) !== isValueNode(b)) {
    return equalDiff(a, b, diff);
  }
  if (!isValueNode(a)) {
    if (a.nodes.length !== b.nodes.length) {
      return equalDiff(a, b, diff);
    }
    for (var i = 0; i < b.nodes.length; i++) {
      if (!equal(a.nodes[i], b.nodes[i], diff)) {
        return false;
      }
    }
  }
  return true;
}
483075
function ensureScalar(value) {
  if (isUndefined(value) || value === null) {
    return value;
  }
  var length = 1;
  var description = 'a scalar';
  if (value.type === vectorProto.type) {
    length = value.size();
    value = value.values[0];
    description = 'a vector';
  } else if (Array.isArray(value)) {
    length = value.length;
    value = value[0];
    description = 'an array';
  }
  if (length !== 1) {
    throw new Error('expected a single scalar value but got ' +
      description + ' of length ' + length);
  }
  return value;
}
336563
private static boolean identityEquals(Object[] a, Object[] a2) {
        if (a == a2) {
            return true;
        }
        if (a == null || a2 == null) {
            return false;
        }

        int length = a.length;
        if (a2.length != length) {
            return false;
        }

        for (int i=0; i<length; i++) {
            if (a[i] != a2[i]) {
                return false;
            }
        }

        return true;
    }
454885
function equals( obj1, obj2 ){
	var t1 = typeof obj1,
		t2 = typeof obj2,
		c,
		i,
		keyCheck;

	if ( obj1 === obj2 ){
		return true;
	}else if ( obj1 !== obj1 && obj2 !== obj2 ){
		return true; // silly NaN
	}else if ( obj1 === null || obj1 === undefined || obj2 === null || obj2 === undefined ){
		return false; // undefined or null
	}else if ( obj1.equals ){
		return obj1.equals( obj2 );
	}else if ( obj2.equals ){
		return obj2.equals( obj1 ); // because maybe somene wants a class to be able to equal a simple object
	}else if ( t1 === t2 ){
		if ( t1 === 'object' ){
			if ( bmoor.isArrayLike(obj1) ){
				if ( !bmoor.isArrayLike(obj2) ){ 
					return false; 
				}

				if ( (c = obj1.length) === obj2.length ){
					for( i = 0; i < c; i++ ){
						if ( !equals(obj1[i], obj2[i]) ) { 
							return false;
						}
					}

					return true;
				}
			}else if ( !bmoor.isArrayLike(obj2) ){
				keyCheck = {};
				for( i in obj1 ){
					if ( obj1.hasOwnProperty(i) ){
						if ( !equals(obj1[i],obj2[i]) ){
							return false;
						}

						keyCheck[i] = true;
					}
				}

				for( i in obj2 ){
					if ( obj2.hasOwnProperty(i) ){
						if ( !keyCheck && obj2[i] !== undefined ){
							return false;
						}
					}
				}
			}
		}
	}

	return false;
}
1311049
private static boolean compareAnnotated(Annotated a1, Annotated a2) {
        return a1.getAnnotations().equals(a2.getAnnotations());
    }
1094562
private static boolean numbersEqual(Number a, Number b) {
        if (a.equals(b)) {
            return true;
        }
        if (a.doubleValue() == b.doubleValue()) {
            return true;
        }
        return false;
    }
302120
private static boolean leq(int a1, int a2, int b1, int b2) {
        return (a1 < b1 || (a1 == b1 && a2 <= b2));
    }
729530
function isEqual (array1, array2) {
    return array1.length === array2.length && array1.every(function (element, index) {
      return element === array2[index];
    });
  }
1368414
function isSameValue(a, b) {
  const [propA, propB] = [a, b].map(value => (
    isArray(value) ? [...value].sort() : value
  ));

  return isEqual(propA, propB);
}
489790
public static boolean isNotEqual(String s1, String s2, int modifier) {
        return !isEqual(s1, s2, modifier);
    }
265493
public static boolean isEqual(Object obj1, Object obj2) {
        if (obj1 != null) {
            return (obj2 != null) && obj1.equals(obj2);
        } else {
            return obj2 == null;
        }
    }
695758
function equal(a,b) {
    if(a instanceof Array) {
        if(!(b instanceof Array))
            return false
        if(a.length !== b.length) {
            return false
        } else {
            for(var n=0; n<a.length; n++) {
                if(!equal(a[n],b[n])) {
                    return false
                }
            }
            // else
            return true
        }
    } else if(a instanceof Object) {
        if(!(b instanceof Object))
            return false

        var aKeys = Object.keys(a)
        var bKeys = Object.keys(b)

        if(aKeys.length !== bKeys.length) {
            return false
        } else {
            for(var n=0; n<aKeys.length; n++) {
                var key = aKeys[n]
                var aVal = a[key]
                var bVal = b[key]

                if(!equal(aVal,bVal)) {
                    return false
                }
            }
            // else
            return true
        }
    } else {
        return a===b || Number.isNaN(a) && Number.isNaN(b)
    }
}
125381
def are_equal(value1, value2):
        
        if value1 == None or value2 == None:
            return True
        if value1 == None or value2 == None:
            return False
        return value1 == value2