Precondition: $values should fail $this->assertion
772614
public function from(GeneratedValueSingle $elements, $exception)
    {
        $branches = [];

        $shrink = function ($elements) use (&$elementsAfterShrink, &$branches) {
            $branches = [];
            $elementsAfterShrink = $this->generator->shrink($elements);
            if ($elementsAfterShrink instanceof GeneratedValueOptions) {
                foreach ($elementsAfterShrink as $each) {
                    $branches[] = $each;
                }
            } else {
                $branches[] = $elementsAfterShrink;
            }
            return $branches;
        };

        $onGoodShrink = function ($elementsAfterShrink, $exceptionAfterShrink) use (&$elements, &$exception, &$branches, $shrink) {
            $elements = $elementsAfterShrink;
            $exception = $exceptionAfterShrink;
            $branches = $shrink($elements);
        };

        $this->timeLimit->start();
        $shrink($elements);
        while ($elementsAfterShrink = array_shift($branches)) {
            if ($this->timeLimit->hasBeenReached()) {
                throw new \RuntimeException(
                    "Eris has reached the time limit for shrinking ($this->timeLimit), here it is presenting the simplest failure case." . PHP_EOL
                    . "If you can afford to spend more time to find a simpler failing input, increase it with the annotation \'@eris-shrink {seconds}\'.",
                    -1,
                    $exception
                );
            }
            // TODO: maybe not necessary
            // when Generator start returning emtpy options instead of the
            // element itself upon no shrinking
            // For now leave in for BC
            if ($elementsAfterShrink == $elements) {
                continue;
            }

            if (!$this->checkGoodShrinkConditions($elementsAfterShrink)) {
                continue;
            }

            foreach ($this->onAttempt as $onAttempt) {
                $onAttempt($elementsAfterShrink);
            }

            Evaluation::of($this->assertion)
                ->with($elementsAfterShrink)
                ->onFailure($onGoodShrink)
                ->execute();
        }

        throw $exception;
    }
972621
function assertProp (
  prop,
  name,
  value,
  vm,
  absent
) {
  if (prop.required && absent) {
    warn(
      'Missing required prop: "' + name + '"',
      vm
    );
    return
  }
  if (value == null && !prop.required) {
    return
  }
  let type = prop.type;
  let valid = !type || type === true;
  const expectedTypes = [];
  if (type) {
    if (!Array.isArray(type)) {
      type = [type];
    }
    for (let i = 0; i < type.length && !valid; i++) {
      const assertedType = assertType(value, type[i]);
      expectedTypes.push(assertedType.expectedType || '');
      valid = assertedType.valid;
    }
  }

  if (!valid) {
    warn(
      getInvalidTypeMessage(name, value, expectedTypes),
      vm
    );
    return
  }
  const validator = prop.validator;
  if (validator) {
    if (!validator(value)) {
      warn(
        'Invalid prop: custom validator check failed for prop "' + name + '".',
        vm
      );
    }
  }
}
160308
function is_valid_value($value) {
        if(is_array($value)) {
            if(!$this->val_multi) {
                return false;
            }
            else {
                foreach($value as $oneval) {
                    if(!rfc2445_is_valid_value($oneval, $this->val_type)) {
                        return false;
                    }
                }
            }
            return true;
        }
        return rfc2445_is_valid_value($value, $this->val_type);
    }
22581
public static function isTrue($value, $format, $args = null, $_ = null) {
        if (!$value) {
            self::vfail($format, array_slice(func_get_args(), 2));
        }
        return $value;
    }
962392
static function assertEqualIterable(iterable $expected, $actual, string $message = ''): void
    {
        static::assertThat($actual, static::equalIterable($expected), $message);
    }
352425
def validate_ok_for_update(update):
    """"""
    validate_is_mapping("update", update)
    # Update can not be {}
    if not update:
        raise ValueError('update only works with $ operators')
    first = next(iter(update))
    if not first.startswith('$'):
        raise ValueError('update only works with $ operators')
55017
public function assertIsNumericAndNonZero($value, $message='%s must be a number and not 0', $exception='Asserts')
    {
        if (is_numeric($value) === false || floatval($value) <= 0) {
            $this->throwException($exception, $message, $value);
        }
    }
35194
public static function isValidValue($value, $strict = false)
    {
        $values = self::getConstantValues();

        return in_array($value, $values, $strict);
    }
461000
static function ensureValue($value)
    {
        if (!self::hasValue($value)) {
            throw new InvalidValueException(sprintf(
                'The value %s is not defined in enum class "%s", known values: %s',
                self::dumpValue($value),
                static::class,
                implode(', ', array_map([static::class, 'dumpValue'], self::getValues()))
            ));
        }
    }
706577
static function assertSameIterable(iterable $expected, $actual, string $message = ''): void
    {
        static::assertThat($actual, static::identicalIterable($expected), $message);
    }
1061076
function hasValue($field, $arguments = null, $cache = true) {
		return ($this->value || $this->value == '0') || ( !$this->nullifyEmpty && $this->value === '');
	}
636060
function Check($value)
    {
        $floatValue = 0.0;
        if (!GlobalNumberParser::TryParse($value, $floatValue)) {
            $this->error = self::NotParsed;
        }
        else {
            if (!$this->CheckMin($floatValue)) {
                 $this->error = self::ExceedsMin; 
            } else if (!$this->CheckMax($floatValue)) {
                $this->error = self::ExceedsMax;
            }
        }
        return $this->error == '';
    }
845351
public function isValid($value)
    {
        if (!$value instanceof WorkflowDispatchEventInterface) {
            $this->error(self::VALIDATE_VALUE_INVALID);
            return false;
        }

        $name = array_key_exists('paramNameInPrepareData', $this->options) ? $this->options['paramNameInPrepareData'] : null;
        if (!is_string($name)) {
            $this->error(self::PARAM_NAME_IN_PREPARE_DATA_INVALID);
            return false;
        }
        $prepareData =  $value->getPrepareData();

        if (!array_key_exists($name, $prepareData)) {
            $this->error(self::PARAM_NOT_FOUND_IN_PREPARE_DATA);
            return false;
        }

        $actualValue = $prepareData[$name];

        $typeExpectedValue = array_key_exists('typeExpectedValue', $this->options) ? $this->options['typeExpectedValue'] : 'string';

        $rawExpectedValue = array_key_exists('expectedValue', $this->options) ? $this->options['expectedValue'] : null;

        try {
            $expectedValue = $this->getExpectedValue($rawExpectedValue, $typeExpectedValue);
        } catch (Exception\InvalidConvertTypeException $e) {
            $this->error(self::ERROR_CONVERT_EXPECTED_VALUE);
            return false;
        }

        return $expectedValue === $actualValue;
    }
992714
function isNotEmpty(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled &&
        ((typeof value === 'string' && value.length !== 0) ||
            (typeof value === 'number' && value !== 0))) {
        throw LogicException.throw(assertionTypes.IS_NOT_EMPTY, value, message, id);
    }
}
132040
protected function isValueTypeValidForExactConditions($value)
    {
        if (is_string($value) || is_bool($value) || is_int($value) || is_float($value)) {
            return true;
        }

        return false;
    }
65802
public function validate($value): void
    {
        if (in_array($value, $this->values)) {
            return;
        }

        throw new Exception\Invalid(
            $value,
            "Invalid value, expected one of " . implode(",", $this->valuesString())
        );
    }
206571
public function isValid($value)
    {
        if (!is_string($value) && !is_int($value) && !is_float($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        if (is_float($value)) {
            return true;
        }

        $this->_setValue($value);
        try {
            if (!Zend_Locale_Format::isFloat($value, array('locale' => $this->_locale))) {
                $this->_error(self::NOT_FLOAT);
                return false;
            }
        } catch (Zend_Locale_Exception $e) {
            $this->_error(self::NOT_FLOAT);
            return false;
        }

        return true;
    }