Asserts that o1 and o2 are distinct, yet equivalent objects
768118
def assert_equivalent(o1, o2):
    '''
    '''
    if not (isinstance(o1, type) and isinstance(o2, type)):
        assert o1 is not o2
    assert o1 == o2
    assert o2 == o1
361019
def _assert_same(values):
    """"""
    assert len(values) > 0
    first, rest = values[0], values[1:]
    for v in rest:
        assert v == first
    return first
1170898
function areSameQuery(queryObj1, queryObj2)
{
	var i,j,len,value1,value1clone,value2,value2clone;
	var queryObj1_length = 0;
	
	for (i in queryObj1)
	{
		value1 = hasOwnProperty.call(queryObj1, i);
		value2 = hasOwnProperty.call(queryObj2, i);
		if (value1===false || value2===false || value1!==value2) return false;
		
		value1 = queryObj1[i];
		value2 = queryObj2[i];
		
		// If strings don't match
		if (value1 !== value2)
		{
			// Don't proceed unless both are arrays
			// "?var1=a&var1=b" would've been parsed to { var1: ["a","b"] }
			if (Array.isArray(value1)===false || Array.isArray(value2)===false) return false;
			
			len = value1.length;
			
			if (len !== value2.length) return false;
			
			// Clone so that sort does not mutate input
			// Sort so that values can possibly match at same indexes
			value1clone = value1.slice().sort();
			value2clone = value2.slice().sort();
			
			for (j=0; j<len; j++)
			{
				if (value1clone[j] !== value2clone[j]) return false;
			}
		}
		
		queryObj1_length++;
	}
	
	if (queryObj1_length !== Object.keys(queryObj2).length) return false;
	
	return true;
}
536299
protected boolean checkConsistency(Object o1, Object o2) {
        return checkConsistency(o1, o2, null, null);
    }
90477
def assertSameType(a, b):
    
    if not isinstance(b, type(a)):
        raise NotImplementedError("This operation is only supported for " \
            "elements of the same type. Instead found {} and {}".
                format(type(a), type(b)))
1363358
public static final <T> int compare(T o1, T o2, Comparator<T> comp)
    {
        if (comp != null)
        {
            return comp.compare(o1, o2);
        }
        else
        {
            return ((Comparable<T>)o1).compareTo(o2);
        }
    }
371976
def identical(self, o):
        
        if self._reversed != o._reversed:
            return False

        for region, si in self.regions.items():
            if region in o.regions:
                o_si = o.regions[region]
                if not si.identical(o_si):
                    return False
            else:
                return False

        return True
131310
final static boolean valEquals(final Object o1, final Object o2) {
    return (o1 == null ? o2 == null : o1.equals(o2));
  }
621057
function isEqualWith (obj1, obj2, func) {
  if (isFunction(func)) {
    return equalCompare(obj1, obj2, function (v1, v2, key, obj1, obj2) {
      var result = func(v1, v2, key, obj1, obj2)
      return isUndefined(result) ? defaultCompare(v1, v2) : !!result
    }, func)
  }
  return equalCompare(obj1, obj2, defaultCompare)
}
568706
@Override
    public final int compare(T o1, T o2){
        if(o1==o2)
            return 0;
        else if(o1==null)
            return -1;
        else if(o2==null)
            return 1;
        else
            return _compare(o1, o2);
    }
638302
function(item1, item2, query) {
            if (typeof item1 === 'object' && typeof item2 === 'object') {
                query = query || {};
                for (var prop in query) {
                    if (item1[prop] !== item2[prop])
                        return false;
                }
                return true;
            }
            return item1 === item2;
        }
702348
function objectEqual(a, b, m) {
  if (!isValue(a) || !isValue(b)) {
    return false;
  }

  if (a.prototype !== b.prototype) {
    return false;
  }

  var i;
  if (m) {
    for (i = 0; i < m.length; i++) {
      if ((m[i][0] === a && m[i][1] === b)
      ||  (m[i][0] === b && m[i][1] === a)) {
        return true;
      }
    }
  } else {
    m = [];
  }

  try {
    var ka = enumerable(a);
    var kb = enumerable(b);
  } catch (ex) {
    return false;
  }

  ka.sort();
  kb.sort();

  if (!iterableEqual(ka, kb)) {
    return false;
  }

  m.push([ a, b ]);

  var key;
  for (i = ka.length - 1; i >= 0; i--) {
    key = ka[i];
    if (!deepEqual(a[key], b[key], m)) {
      return false;
    }
  }

  return true;
}
536120
private boolean isEqual(Object o1, Object o2) {
		return o1 == null ? o2 == null : o1.equals(o2);
	}
698152
function(a0, a1) {
		var i, ilen, v0, v1;

		if (!a0 || !a1 || a0.length !== a1.length) {
			return false;
		}

		for (i = 0, ilen = a0.length; i < ilen; ++i) {
			v0 = a0[i];
			v1 = a1[i];

			if (v0 instanceof Array && v1 instanceof Array) {
				if (!helpers.arrayEquals(v0, v1)) {
					return false;
				}
			} else if (v0 !== v1) {
				// NOTE: two different object instances will never be equal: {x:20} != {x:20}
				return false;
			}
		}

		return true;
	}
644800
public static boolean equalsValue(final Object o1, final Object o2) {
        if (o1 == null) {
            return o2 == null;
        }
        return o1.equals(o2);
    }
388576
function isOpponentsEqual(exOpponents, currentOpponents) {
    var ans = false,
        cOpponents = currentOpponents.sort();

    if (exOpponents.length) {
        exOpponents.forEach(function(i) {
            var array = i.sort();

            ans = (array.length == cOpponents.length) && array.every(function(el, index) {
                return el === cOpponents[index];
            });
        });
    }

    return ans;
}
577210
function shallowEqual(objA, objB) {
  if (objA === objB) {
    return true;
  }
  var key;
  // Test for A's keys different from B.
  for (key in objA) {
    if (objA.hasOwnProperty(key) &&
        (!objB.hasOwnProperty(key) || objA[key] !== objB[key])) {
      return false;
    }
  }
  // Test for B's keys missing from A.
  for (key in objB) {
    if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) {
      return false;
    }
  }
  return true;
}