return true if a <= b (arrays are assumed padded with zeros).
354578
private boolean lessThanOrEqual(
         byte[] a,
         byte[] b)
    {
         if (a.length <= b.length)
         {
             for (int i = 0; i != a.length; i++)
             {
                 int    l = a[i] & 0xff;
                 int    r = b[i] & 0xff;

                 if (r > l)
                 {
                     return true;
                 }
                 else if (l > r)
                 {
                     return false;
                 }
             }

             return true;
         }
         else
         {
             for (int i = 0; i != b.length; i++)
             {
                 int    l = a[i] & 0xff;
                 int    r = b[i] & 0xff;

                 if (r > l)
                 {
                     return true;
                 }
                 else if (l > r)
                 {
                     return false;
                 }
             }

             return false;
         }
    }
495406
private function isArrayContentsEqual($a, $b)
    {
        foreach ($b as $one) {
            $pos = array_search($one, $a, true);
            if ($pos === false) {
                return false;
            } else {
                unset($a[$pos]);
            }
        }

        return $a ? false : true;
    }
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)
    }
}
50102
def numpy_aware_eq(a, b):
    
    if isinstance(a, np.ndarray) or isinstance(b, np.ndarray):
        return np.array_equal(a, b)
    if ((isinstance(a, Iterable) and isinstance(b, Iterable)) and
            not isinstance(a, str) and not isinstance(b, str)):
        if len(a) != len(b):
            return False
        return all(numpy_aware_eq(x, y) for x, y in zip(a, b))
    return a == b
179460
private boolean checkEquality(HashMap<String, Double> a,
			HashMap<String, Double> b) {
		for(String s: a.keySet()){
			if(Double.compare(a.get(s), b.get(s)) != 0)
				return false;
		}
		return true;
	}
313569
public static boolean arrayEquals(List<String> a, List<String> b) {
        if (a == null) {
            a = new ArrayList<>();
        }
        if (b == null) {
            b = new ArrayList<>();
        }
        if (a.size() != b.size()) {
            return false;
        }

        for (int i = 0; i < a.size(); i ++) {
            if (!a.get(i).equals(b.get(i))) {
                return false;
            }
        }
        return true;
    }
861328
def zero_pad(data, count, right=True):
    
    if len(data) == 0:
        return np.zeros(count)
    elif len(data) < count:
        padded = np.zeros(count)
        if right:
            padded[-len(data):] = data
        else:
            padded[:len(data)] = data
        return padded
    else:
        return np.asanyarray(data)
504182
function equalSimpleArrays(arr1, arr2) {

	if (arr1 && (arr1.length > 0))
		return (
			arr2 &&
				(arr2.length === arr1.length) &&
				arr2.every((v, i) => (v === arr1[i]))
		);

	return (!arr2 || (arr2.length === 0));
}
1293993
def identical?(a, b)
        return true if a.nil? && b.nil?
        return false if a.nil? || b.nil?
        return false unless a.bytesize == b.bytesize
        a.bytes.zip(b.bytes).reduce(0) { |memo, (a, b)| memo += a ^ b } == 0
      end
1225184
def pad(a, desiredlength):
    

    if len(a) >= desiredlength:
        return a

    islist = isinstance(a, list)
    a = np.array(a)
    diff = desiredlength - len(a)
    shape = list(a.shape)
    shape[0] = diff

    padded = np.concatenate([a, np.zeros(shape, dtype=a.dtype)])
    return padded.tolist() if islist else padded
400342
public static boolean cmp(byte[] a, byte[] b) {
		if(a.length != b.length) {
			return false;
		}
		for(int i = 0; i < a.length; i++) {
			if(a[i] != b[i]) {
				return false;
			}
		}
		return true;
	}
387084
def check_padding(pads, dim, padval):
    """"""
    asymmetry = False
    for i in range(dim):
        s = pads[i]
        e = pads[i+dim]
        if s == e:
            padval.append(s)
        else:
            asymmetry = True
            # We must add a separate pad function for asymmetry padding.
            # Since the pad function will do all the padding,
            # we will remove all padding here.
            del padval[:]
            padval.extend([0]*dim)
            break
    return asymmetry
811853
def deep_equal(a, b):
    
    if is_any_string_type(a) and is_any_string_type(b):
        if isinstance(a, six.binary_type):
            a = six.text_type(a, encoding='utf-8')
        if isinstance(b, six.binary_type):
            b = six.text_type(b, encoding='utf-8')
        return a == b
    return a == b and isinstance(a, type(b)) and isinstance(b, type(a))
176444
function isSubSet (aTestArray, aRefArray) {
		function isOutsideSet(sTestValue) {
			return aRefArray.indexOf(sTestValue) < 0; // value is not part of the reference set
		}
		return aTestArray && aRefArray && !aTestArray.some(isOutsideSet);
	}
155094
def check(a, b):
    
    aencrypt = encrypt(a)
    bencrypt = encrypt(b)

    return a == b or a == bencrypt or aencrypt == b
919551
function(b1, b2) {
  var mismatch = 0;
  mismatch |= !(b1 instanceof Buffer);
  mismatch |= !(b2 instanceof Buffer);
  mismatch |= b1.length !== b2.length;
  if (mismatch === 1) {
    return false;
  }
  var n = b1.length;
  for (var i = 0; i < n; i++) {
    mismatch |= b1[i] ^ b2[i];
  }
  return mismatch === 0;
}
107471
def compare_arrays(left, right):
    ""
    return (
        left is right
        or ((left.shape == right.shape) and (left == right).all())
    )