Compares the contents of an array and a Vector for equality.
973781
public static boolean sameList(final Vector v, final Object[] a) {
    if (v == null || a == null || v.size() != a.length) {
      return false;
    }
    for (int i = 0; i < a.length; i++) {
      final Object o = a[i];
      if (!o.equals(v.elementAt(i))) {
        return false;
      }
    }
    return true;
  }
799589
public final static boolean arrayEquals(Object[] source, Object target) {
        if (source == null) return (target == null);
        if (!(target instanceof Object[])) return false;
        Object[] targ = (Object[]) target;
        return (source.length == targ.length
                && arrayRegionMatches(source, 0, targ, 0, source.length));
    }
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)
    }
}
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;
    }
222128
protected boolean arraysEqual(Object[] a1, Object[] a2) {
		if (a1 != null && a2 != null && a1.length == a2.length) {
			// Loop over each element and compare them using our comparator
			for (int i = 0; i < a1.length; i++) {
				if (!equalByComparator(a1[i], a2[i])) {
					return false;
				}
			}
			return true;
		}
		else if (a1 == null && a2 == null) {
			return true;
		}
		return false;
	}
507495
function _same_array(one, two){
	var retval = true;
	if( one.length != two.length ){
	    retval = false;
	}else{
	    for( var i = 0; i < one.length; i++ ){
		if( one[i] != two[i] ){
		    retval = false;
		    break;
		}
	    }
	}
	return retval;
    }
737531
function equalArrays(array1, array2) {
  // if the other array is a falsy value, return
  if (!array1 || !array2)
      return false;

  // compare lengths - can save a lot of time
  if (array1.length != array2.length)
      return false;

  for (var i = 0, l=array1.length; i < l; i++) {
      // Check if we have nested arrays
      if (array1[i] instanceof Array && array2[i] instanceof Array) {
          // recurse into the nested arrays
          if (!equalArrays(array1[i],array2[i]))
              return false;
      }
      else if (array1[i] != array2[i]) {
          // Warning - two different object instances will never be equal: {x:20} != {x:20}
          return false;
      }
  }
  return true;
}
110329
function arrayIncludes(arr, v) {
  for (let i = 0, len = arr.length; i < len; i++) {
    const av = arr[i];

    if (Tyr.isEqual(av, v)) {
      return true;
    }
  }

  return false;
}
107471
def compare_arrays(left, right):
    ""
    return (
        left is right
        or ((left.shape == right.shape) and (left == right).all())
    )
281868
function _arrEquals(a, b) {
    return a.length == b.length &&
        a.every((el, i) => _equals(el, b[i]));
}
696788
function equals(a, b) {
    function checkArray(n, m) {
        var i, len;

        for(i = 0, len = n.length; i < len; i++) {
            if(!equals(n[i], m[i])) {
                return false;
            }
        }

        return true;
    }

    function checkObject(n, m) {
        var i;

        for(i in n) {
            if(n.hasOwnProperty(i)) {
                if(!m.hasOwnProperty(i)) {
                    return false;
                }
                if(!equals(n[i], m[i])) {
                    return false;
                }
            }
        }

        return true;
    }

    if(!is.defined(a) && !is.defined(b)) {
        return true;
    }
    if(!is.defined(a) || !is.defined(b)) {
        return false;
    }
    if(is.array(a) && is.array(b)) {
        return checkArray(a, b) && checkArray(b, a);
    }
    if(!is.array(a) && is.object(a) && !is.array(b) && is.object(b)) {
        return checkObject(a, b) && checkObject(b, a);
    }
    if(!is.array(a) && !is.object(a) && !is.string(a) && isNaN(a)) {
        return true;
    }

    return a === b;
}
403721
public static boolean equal(Object obj1, Object obj2) {
        if (obj1 == obj2) {
            return true;
        }
        if (obj1 == null || obj2 == null) {
            return false;
        }
        if (obj1.getClass().isArray()) {
            return equalsArray(obj1, obj2);
        }
        // this does not handle arrays embedded in objects, such as in lists/maps
        // but you shouldn't use arrays like that, should you?
        return obj1.equals(obj2);
    }
1314818
public static boolean arrayEquals(
      Object leftBase, long leftOffset, Object rightBase, long rightOffset, final long length) {
    int i = 0;

    // check if stars align and we can get both offsets to be aligned
    if ((leftOffset % 8) == (rightOffset % 8)) {
      while ((leftOffset + i) % 8 != 0 && i < length) {
        if (Platform.getByte(leftBase, leftOffset + i) !=
            Platform.getByte(rightBase, rightOffset + i)) {
              return false;
        }
        i += 1;
      }
    }
    // for architectures that support unaligned accesses, chew it up 8 bytes at a time
    if (unaligned || (((leftOffset + i) % 8 == 0) && ((rightOffset + i) % 8 == 0))) {
      while (i <= length - 8) {
        if (Platform.getLong(leftBase, leftOffset + i) !=
            Platform.getLong(rightBase, rightOffset + i)) {
              return false;
        }
        i += 8;
      }
    }
    // this will finish off the unaligned comparisons, or do the entire aligned
    // comparison whichever is needed.
    while (i < length) {
      if (Platform.getByte(leftBase, leftOffset + i) !=
          Platform.getByte(rightBase, rightOffset + i)) {
            return false;
      }
      i += 1;
    }
    return true;
  }
403595
public static function equal(array $a, array $b): bool
    {
        // Elements count should be equal
        $count_equal = (\count($a) === \count($b));
        // Between the keys should not be differences
        $difference = (array_diff($a, $b) === array_diff($b, $a));

        return ($count_equal && $difference);
    }
91196
public static boolean sameSet(final Object[] a, final Vector b) {
    if (a == null || b == null || a.length != b.size()) {
      return false;
    }
    if (a.length == 0) {
      return true;
    }
    // Convert the array into a set
    final Hashtable t = new Hashtable();
    for (final Object element : a) {
      t.put(element, element);
    }
    for (int i = 0; i < b.size(); i++) {
      final Object o = b.elementAt(i);
      if (t.remove(o) == null) {
        return false;
      }
    }
    return t.size() == 0;
  }
857891
public static void plusMinusEquals(double[] add, double[] sub, NumberVector vec) {
    for(int d = 0; d < add.length; d++) {
      final double v = vec.doubleValue(d);
      add[d] += v;
      sub[d] -= v;
    }
  }
59168
private static boolean deepEquals(byte[] a, byte[] b) {
        return a == b || !(a == null || b == null) && Arrays.equals(a, b);
    }