Wraps Jasmine2 matcher to be compliant with Jasmine 1 API.
434817
function wrapper(matcherName, legacyMatcher){
      return function(util, customEqualityTesters){
        return { 
          compare: function(actual, expected){
            var scope = {actual: actual}, message, result;
            
            result = legacyMatcher.call(scope, expected)
            
            message = scope.message && scope.message()[result ? 1 : 0];
            return {
              pass:result,
              message : message
            }
          }
        }
      }
    }
243627
def match(self, expression=None, xpath=None, namespaces=None): 
        """"""
        class MatchObject(Dict):
            pass
        def _match(function):
            self.matches.append(
                MatchObject(expression=expression, xpath=xpath, function=function, namespaces=namespaces))
            def wrapper(self, *args, **params):
                return function(self, *args, **params)
            return wrapper
        return _match
529803
def alwaysCalledWithMatch(cls, spy, *args, **kwargs): #pylint: disable=invalid-name
        
        cls.__is_spy(spy)
        if not (spy.alwaysCalledWithMatch(*args, **kwargs)):
            raise cls.failException(cls.message)
419182
@Factory
    public static <T extends Throwable> Matcher<T> withMessage(final Matcher<String> matcher) {
        return new CustomTypeSafeMatcher<T>(CustomMatchers.fixedDescription("message ", matcher)) {
            @Override
            protected boolean matchesSafely(T item) {
                return matcher.matches(item.getMessage());
            }

            public void describeMismatchSafely(T item, Description mismatchDescription) {
                matcher.describeMismatch(item.getMessage(), mismatchDescription);
            }
        };
    }
233598
function(a, match, msg) {
    return assert((this.assertIsString(a, msg) && a.match(match)!==null), msg);
  }
795182
private static Matcher<Tree> shouldAllow(RestrictedApi api) {
    try {
      return Matchers.hasAnyAnnotation(api.whitelistAnnotations());
    } catch (MirroredTypesException e) {
      return Matchers.hasAnyAnnotation(e.getTypeMirrors());
    }
  }
649327
function MatchResult(
    matcher,
    input,
    startExpr,
    cst,
    cstOffset,
    rightmostFailurePosition,
    optRecordedFailures) {

  this.matcher = matcher;
  this.input = input;
  this.startExpr = startExpr;
  this._cst = cst;
  this._cstOffset = cstOffset;
  this._rightmostFailurePosition = rightmostFailurePosition;
  this._rightmostFailures = optRecordedFailures;

  if (this.failed()) {
    common.defineLazyProperty(this, 'message', function() {
      var detail = 'Expected ' + this.getExpectedText();
      return util.getLineAndColumnMessage(this.input, this.getRightmostFailurePosition()) + detail;
    });
    common.defineLazyProperty(this, 'shortMessage', function() {
      var detail = 'expected ' + this.getExpectedText();
      var errorInfo = util.getLineAndColumn(this.input, this.getRightmostFailurePosition());
      return 'Line ' + errorInfo.lineNum + ', col ' + errorInfo.colNum + ': ' + detail;
    });
  }
}
266956
static Matcher sequenceWithStuffAfterEndIsFalse(Matcher matcher) {
    if (matcher instanceof SeqMatcher) {
      boolean end = false;
      for (Matcher m : matcher.<SeqMatcher>as().matchers()) {
        if (m instanceof EndMatcher) {
          end = true;
        } else if (end && !m.alwaysMatches()) {
          return FalseMatcher.INSTANCE;
        }
      }
    }
    return matcher;
  }
373373
function( e, match ) {
		var result = { passed: false }, message = '';

		// Get a string for matching on the error
		if ( munit.isError( e ) ) {
			message = e.message;
		}
		else if ( munit.isString( e ) ) {
			message = e;
		}

		// No match required
		if ( match === undefined ) {
			result.passed = true;
		}
		// Non Error/String error object, string matching required
		else if ( ! munit.isError( e ) && ! munit.isString( e ) ) {
			if ( e === match ) {
				result.passed = true;
			}
			else {
				result.extra = "Match object '" + match + "' does not match error '" + e + "'";
			}
		}
		// Function error class matching
		else if ( munit.isFunction( match ) ) {
			if ( e instanceof match ) {
				result.passed = true;
			}
			else {
				result.extra = "Error does not match class '" + match.name + "'";
			}
		}
		// Regex checking on the error message
		else if ( munit.isRegExp( match ) ) {
			if ( match.exec( message ) ) {
				result.passed = true;
			}
			else {
				result.extra = "Regex (" + match + ") could not find match on:\n" + message;
			}
		}
		// String matching on the error message
		else if ( munit.isString( match ) ) {
			if ( match === message ) {
				result.passed = true;
			}
			else {
				result.extra = "Error message doesn't match:\nActual: " + message + "\nExpected: " + match;
			}
		}
		// Unkown error type passed
		else {
			result.extra = "Unknown error match type '" + match + "'";
		}

		return result;
	}
1184867
function validatorWrapper(validators, name, validator) {
    return function (value, options) {
        var error = void 0,
            args = arguments;
        var alias = this && this.alias;
        var validatorObj = validators[name];
        var validatorAliasObj = alias ? validators[alias] : {};
        var arg = validatorObj[ARG] || validatorAliasObj[ARG] || validators[ARG];
        var isSimpleArgsFormat = validatorObj[SIMPLE_ARGS_FORMAT] || validatorAliasObj[SIMPLE_ARGS_FORMAT] || validators[SIMPLE_ARGS_FORMAT];

        options = assign({}, validatorObj.defaultOptions, validatorAliasObj.defaultOptions, options);

        if (typeof options.parse === 'function') {
            value = options.parse(value);
        }

        if (options.hasOwnProperty(arg) && !isSimpleArgsFormat) {
            args = [value, options[arg]].concat(Array.prototype.slice.call(arguments, 1));
        }

        try {
            var resultHandler = validatorObj[RESULT_HANDLER] || validatorAliasObj[RESULT_HANDLER] || validators[RESULT_HANDLER];

            error = resultHandler(validator.apply(validators, args));
        } catch (err) {
            var exceptionHandler = validatorObj[EXCEPTION_HANDLER] || validatorAliasObj[EXCEPTION_HANDLER] || validators[EXCEPTION_HANDLER];

            if (typeof exceptionHandler === 'function') {
                error = exceptionHandler(err);
            } else {
                throw err;
            }
        }

        function handleError(error) {
            if (error) {
                var _ret = function () {
                    var errorObj = (typeof error === 'undefined' ? 'undefined' : _typeof(error)) === 'object' ? error : null; //in case if we rewrite message in options and want to use fields from error object in the placeholders
                    var message = options[MESSAGE] || validatorObj[MESSAGE] || validatorAliasObj[MESSAGE];

                    if (message) {
                        error = message;
                    }

                    var formattedErrorMessage = validators.formatMessage(error, assign({ validator: alias || name, value: value }, errorObj, options));
                    var format = validatorObj[ERROR_FORMAT] || validatorAliasObj[ERROR_FORMAT] || validators[ERROR_FORMAT];

                    if (format) {
                        if (typeof formattedErrorMessage === 'string') {
                            formattedErrorMessage = { message: formattedErrorMessage };
                        }

                        if (format.$options) {
                            format = assign({}, format);

                            Object.keys(options).forEach(function (key) {
                                if (!MESSAGE_REGEXP.test(key) && typeof options[key] !== 'function') {
                                    format[key] = options[key];
                                }
                            });
                        }
                        delete format.$options;

                        if (format.$origin) {
                            format = assign({}, format, formattedErrorMessage);
                        }
                        delete format.$origin;

                        return {
                            v: validators.formatMessage(format, assign({ validator: alias || name, value: value }, options, formattedErrorMessage))
                        };
                    }

                    return {
                        v: formattedErrorMessage
                    };
                }();

                if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
            }
        }

        return (typeof error === 'undefined' ? 'undefined' : _typeof(error)) === 'object' && typeof error.then === 'function' ? error.then(handleError) : handleError(error);
    };
}
611149
function __match(regexp) {
  return function(ch) { 
  	return !!(ch !== DONE && (ch === undefined || ch.match(regexp)))? MATCH_TRUE: MATCH_FALSE };
}
210246
def create(pattern, casesensitive=True):
        """"""
        casesensitive = determine_casesensitive(casesensitive)
        if "?" in pattern or "*" in pattern:
            return FNMatcher(pattern, casesensitive)
        else:
            return ConstantMatcher(pattern, casesensitive)
752214
protected boolean nestedMatch(Matcher<?> matcher, Object item, Description mismatch) {
        return Nested.matches(this, matcher, item, mismatch);
    }
445933
function (valueSelector, matcher, isRoot) {
  if (_.isRegExp(valueSelector)) {
    matcher._isSimple = false;
    return convertElementMatcherToBranchedMatcher(
      regexpElementMatcher(valueSelector));
  } else if (isOperatorObject(valueSelector)) {
    return operatorBranchedMatcher(valueSelector, matcher, isRoot);
  } else {
    return convertElementMatcherToBranchedMatcher(
      equalityElementMatcher(valueSelector));
  }
}
1365290
def _is_base_matcher_class_definition(meta, classname, dict_):
        
        if classname != 'BaseMatcher':
            return False
        methods = list(filter(inspect.isfunction, dict_.values()))
        return methods and all(m.__module__ == __name__ for m in methods)
960080
@SuppressWarnings("UnusedDeclaration")
  public static <T> void expect(T value, Matcher<? super T> matcher) {
    that(value, matcher);
  }
316048
def __create_matcher(self, match_class, **keywds):
        """"""
        matcher_args = keywds.copy()
        del matcher_args['function']
        del matcher_args['recursive']
        if 'allow_empty' in matcher_args:
            del matcher_args['allow_empty']

        decl_matcher = decl_matcher = match_class(**matcher_args)
        if keywds['function']:
            self._logger.debug(
                'running query: %s and <user defined function>',
                str(decl_matcher))
            return lambda decl: decl_matcher(decl) and keywds['function'](decl)

        self._logger.debug('running query: %s', str(decl_matcher))
        return decl_matcher