expect length function for matchJSONLength that does the comparison operations
168664
function(jsonBody, lengthSegments) {
  let len = 0

  if (_.isObject(jsonBody)) {
    len = Object.keys(jsonBody).length
  } else {
    len = jsonBody.length
  }

  let msg // message for expectation result
  //TODO: in the future, use expect(jsonBody).to.have.length.below(lengthSegments.count + 1); or similar for non-objects to get better assertion messages
  switch (lengthSegments.sign) {
    case '<=':
      msg =
        'Expected length to be less than or equal to ' +
        lengthSegments.count +
        ', but got ' +
        len
      expect(len).to.be.lessThan(lengthSegments.count + 1, msg)
      break
    case '<':
      msg =
        'Expected length to be less than ' +
        lengthSegments.count +
        ', but got ' +
        len
      expect(len).to.be.lessThan(lengthSegments.count, msg)
      break
    case '>=':
      msg =
        'Expected length to be greater than or equal ' +
        lengthSegments.count +
        ', but got ' +
        len
      expect(len).to.be.greaterThan(lengthSegments.count - 1, msg)
      break
    case '>':
      msg =
        'Expected length to be greater than ' +
        lengthSegments.count +
        ', but got ' +
        len
      expect(len).to.be.greaterThan(lengthSegments.count, msg)
      break
    case null:
      msg = 'Expected length to be ' + lengthSegments.count + ', but got ' + len
      expect(len).to.equal(lengthSegments.count, msg)
      break
  } //end switch
}
289828
function ( value ) {
		var tmp;

		if ( value === null || value === undefined ) {
			return undefined;
		}
		else if ( value === "true" ) {
			return true;
		}
		else if ( value === "false" ) {
			return false;
		}
		else if ( value === "null" ) {
			return null;
		}
		else if ( value === "undefined" ) {
			return undefined;
		}
		else if ( value === "" ) {
			return value;
		}
		else if ( !isNaN( tmp = Number( value ) ) ) {
			return tmp;
		}
		else if ( regex.json_wrap.test( value ) ) {
			return json.decode( value, true ) || value;
		}
		else {
			return value;
		}
	}
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
  })
}
97351
function getLength(value) {
  if (typeof value !== 'object') {
    return 0;
  }

  if (isValue(value.length)) {
    return value.length;
  }

  return Object.keys(value).length;
}
847628
function(match, value, len) {
			var num = '' + value;
			if (lookAhead(match))
				while (num.length < len)
					num = '0' + num;
			return num;
		}
393626
function checkFieldLength(parsed, field, length) {
  length = length || transactionFields[field].options.length;
  if (parsed.transactions[field] && parsed.transactions[field].toString().length > length) {
    console.log(parsed.transactions);
    console.log(field, parsed.transactions[field]);
  }
}
429922
def fit_size(min_length: int = 0, max_length: int = None,
             message=None) -> Filter_T:
    

    def validate(value):
        length = len(value) if value is not None else 0
        if length < min_length or \
                (max_length is not None and length > max_length):
            _raise_failure(message)
        return value

    return validate
520789
public static void assertJsonPartEquals(Object expected, Object fullJson, String path, Configuration configuration) {
        Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
        diff.failIfDifferent();
    }
161764
function compare (checkDictionary, path, pathContent) {
        var subPromises = [];
        pathContent.forEach(function (name) {
            var JS_EXT = ".js",
                JS_EXT_LENGTH = JS_EXT.length,
                contentFullName = path + name,
                contentFullNameLength = contentFullName.length;
            if (contentFullNameLength > JS_EXT_LENGTH
                && contentFullName.indexOf(JS_EXT) === contentFullNameLength - JS_EXT_LENGTH) {
                contentFullName = contentFullName.substring(START, contentFullNameLength - JS_EXT_LENGTH);
                if (checkDictionary[contentFullName] === "obsolete") {
                    checkDictionary[contentFullName] = "exists";
                } else {
                    checkDictionary[contentFullName] = "new";
                }
            } else if (name.indexOf(".") === NOT_FOUND) {
                subPromises.push(gpf.http.get("/fs/src/" + contentFullName)
                    .then(function (response) {
                        return JSON.parse(response.responseText);
                    })
                    .then(function (subPathContent) {
                        return compare(checkDictionary, contentFullName + "/", subPathContent);
                    }));
            }
        });
        if (!subPromises.length) {
            return Promise.resolve();
        }
        return Promise.all(subPromises);
    }
1209802
def _ensure_length(encoded, min_length, alphabet, guards, values_hash):
    """"""
    len_guards = len(guards)
    guard_index = (values_hash + ord(encoded[0])) % len_guards
    encoded = guards[guard_index] + encoded

    if len(encoded) < min_length:
        guard_index = (values_hash + ord(encoded[2])) % len_guards
        encoded += guards[guard_index]

    split_at = len(alphabet) // 2
    while len(encoded) < min_length:
        alphabet = _reorder(alphabet, alphabet)
        encoded = alphabet[split_at:] + encoded + alphabet[:split_at]
        excess = len(encoded) - min_length
        if excess > 0:
            from_index = excess // 2
            encoded = encoded[from_index:from_index+min_length]

    return encoded
580045
def fixed_length_secure_compare(a, b)
      raise ArgumentError, "string length mismatch." unless a.bytesize == b.bytesize

      l = a.unpack "C#{a.bytesize}"

      res = 0
      b.each_byte { |byte| res |= byte ^ l.shift }
      res == 0
    end
1228895
static void isCorrectLength(byte[] object, int length, String name) {
    Validate.notNull(object, "%s cannot be null.", name);

    Validate.isTrue(object.length == length,
        "%s should be %d bytes, found %d bytes.", name, length, object.length);
  }
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
801584
function expectJSON(fn, res) {
  bluebird.try(fn).then(function (result) {
    res.json(result);
  }).catch(handleError(res));
}
666443
function getStringWithLength(string, find) {
    let obj;
    // if regex then do it regex way
    if(XRegExp.isRegExp(find)) {
      obj = {
        textValue: XRegExp.replace(string, find, '$1', 'one'),
        textLength: XRegExp.match(string, /class/g, 'one')
          .length
      };
      return;
    } else {
      obj = {
        textValue: find,
        textLength: find.length
      };
    }
    return obj;
  }
1258072
function matches(str, match) {
    if (Array.isArray(match)) {
        var l = match.length;
        for( var s=0; s < l; s++) {
            if ( mm(str,match[s])) {
                return true;
            }
        }
        return false;
    }
    return match.test(str);
}
855269
function match(input) {
    let lowerInput = input.toLowerCase();
    let simpleMatch = _simpleMatch(lowerInput);
    let complexMatch = _complexMatch(lowerInput);
    let output = simpleMatch.concat(complexMatch);

    return output;
}