helper function that compares length and values of expectations
774450
function isMatching(result, expectation) {
  if (result.length !== expectation.length) {
    return false;
  }

  // convert results and expectations to strings for easier comparison
  result = result.map(item => item.toString());
  expectation = expectation.map(item => getBox(item).toString());

  const reduce_callback = function (previous_result, current_item) {
    return previous_result === true && result.indexOf(current_item) > -1;
  };

  return expectation.reduce(reduce_callback, true);
}
570668
function(actual, expected, negate, name) {
      return 'expected ' + puts(actual) + ' to ' + 
               (negate ? 'not ' : '') + 
                  name.replace(/_/g, ' ') +
                    ' ' + (expected.length > 1 ?
                      puts.apply(this, expected.slice(1)) :
                        '')
    }
1314859
def _expectation(p, kern, feat, none2, none3, nghp=None):
    
    """
    return functools.reduce(tf.add, [
        expectation(p, (k, feat), nghp=nghp) for k in kern.kernels])
670093
function eventuallyEqual(promise, expected, done) {
    all([
        promise.should.be.fulfilled,
        promise.should.eventually.deep.equal(expected)
    ], done);
}
751764
def _check_len(a, b):
    
    if len(a) != len(b):
        msg = "Length must be {}. Got {}".format(len(a), len(b))
        raise ValueError(msg)
247277
async function compareString (filename, expectedContents) {
  try {
    const actualContents = await fs.readFile(filename, { encoding: 'utf8' })
    return actualContents !== expectedContents
  } catch (err) {
    return handleError(err)
  }
}
669703
function (f, d) {

        f = makeCompareFunction(f, d);
        f.thenBy = tb;
        return f;
    }
1120824
function comparison(model, options, keys, index=0) {
  const key = keys[index];

  if (keys.length === index) {
    return model[key] === options[key];
  } else if (model[key] === options[key]) {
    return comparison(model, options, keys, index + 1);
  }

  return false;
}
680801
function( name, actual, expected ) {
		return this.ok( name, actual !== expected, this.notEqual, "\nValues should not match\nActual:" + actual + "\nExpected:" + expected );
	}
281868
function _arrEquals(a, b) {
    return a.length == b.length &&
        a.every((el, i) => _equals(el, b[i]));
}
260741
function compareResults (matches, elements) {
  const { length } = matches
  return length === elements.length && elements.every((element) => {
    for (var i = 0; i < length; i++) {
      if (matches[i] === element) {
        return true
      }
    }
    return false
  })
}
1173746
async function compareBuffer (filename, expectedContents) {
  try {
    const actualContents = await fs.readFile(filename)
    return !expectedContents.equals(actualContents)
  } catch (err) {
    return handleError(err)
  }
}
827924
def eq(self, other):
        
        # We treat this as an error because missing_values have NaN semantics,
        # which means this would return an array of all False, which is almost
        # certainly not what the user wants.
        if other == self.missing_value:
            raise ValueError(
                "Comparison against self.missing_value ({value!r}) in"
                " {typename}.eq().\n"
                "Missing values have NaN semantics, so the "
                "requested comparison would always produce False.\n"
                "Use the isnull() method to check for missing values.".format(
                    value=other,
                    typename=(type(self).__name__),
                )
            )

        if isinstance(other, Number) != (self.dtype == int64_dtype):
            raise InvalidClassifierComparison(self, other)

        if isinstance(other, Number):
            return NumExprFilter.create(
                "x_0 == {other}".format(other=int(other)),
                binds=(self,),
            )
        else:
            return ArrayPredicate(
                term=self,
                op=operator.eq,
                opargs=(other,),
            )
998821
function (actualArgs, expectedArgs) {
    var i;
    if (actualArgs.length !== expectedArgs.length) {
      return false;
    }
    for (i = 0; i < expectedArgs.length; i++) {
      if (actualArgs[i] !== expectedArgs[i]) {
        return false;
      }
    }
    return true;
  }
98949
function (/*util*/) {

      function compare(actual, expected) {
        return {
          pass: actual instanceof Error && ('' + actual).indexOf(expected) >= 0
        }
      }

      return {compare: compare}
    }
802613
function compare([l, ...left], [r, ...right]) {
  if (l < r) {
    return -1;
  }
  if (l > r) {
    return 1;
  }

  if (left.length === 0) {
    return 0;
  }

  return compare(left, right);
}
140634
def length(min=None, max=None):
    

    def validate(value):
        if min and len(value) < min:
            return e("{} does not have a length of at least {}", value, min)
        if max and len(value) > max:
            return e("{} does not have a length of at most {}", value, max)
    return validate