Check if the condition has been met.
        We need to make sure that we are of the correct type.
768206
def _check_valid_condition(self, get_params):
        
        try:
            variable = get_params(self.variable)
        except:  # noqa e722
            variable = None
        value = self.value

        # if None, return oppositely
        if variable is None:
            return not self.default

        # convert the value to a correct type
        if isinstance(variable, bool):
            value = bool(self.value)
        elif isinstance(variable, Number):
            try:
                value = int(self.value)
            except:  # noqa e722
                try:
                    value = float(self.value)
                except:  # noqa e722
                    # could not parse
                    return not self.default

        # compare and return the result
        if self.condition == "=":
            return (variable == value) == self.default
        elif self.condition == ">":
            return (variable > value) == self.default
        elif self.condition == "<":
            return (variable < value) == self.default
353821
public function isMatching()
    {
        $condition1 = $this->conditionValidator->variableOpComparison(
            $this->facade->getCartTotalTaxPrice(),
            $this->operators[self::CART_TOTAL],
            $this->values[self::CART_TOTAL]
        );

        if ($condition1) {
            $condition2 = $this->conditionValidator->variableOpComparison(
                $this->facade->getCheckoutCurrency(),
                $this->operators[self::CART_CURRENCY],
                $this->values[self::CART_CURRENCY]
            );

            if ($condition2) {
                return true;
            }
        }

        return false;
    }
641542
def does_fragment_condition_match(
        self,
        fragment: Union[FragmentDefinitionNode, InlineFragmentNode],
        type_: GraphQLObjectType,
    ) -> bool:
        """"""
        type_condition_node = fragment.type_condition
        if not type_condition_node:
            return True
        conditional_type = type_from_ast(self.schema, type_condition_node)
        if conditional_type is type_:
            return True
        if is_abstract_type(conditional_type):
            return self.schema.is_possible_type(
                cast(GraphQLAbstractType, conditional_type), type_
            )
        return False
1082702
public function check() {
        if ($this->_exist) {
            foreach ($this->_constraints as $constraint) {
                switch ($constraint['type']) {
                    case self::ACCEPT:
                        if (!is_array($this->_data[$this->_field]['type'])) {
                            $this->_data[$this->_field]['type'] = [$this->_data[$this->_field]['type']];
                        }

                        foreach ($this->_data[$this->_field]['type'] as $value) {
                            if ($value != '') {
                                if (!in_array($value, $constraint['value'])) {
                                    array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                                }
                            }
                        }
                        break;

                    case self::EXTENSION:
                        if (!is_array($this->_data[$this->_field]['name'])) {
                            $this->_data[$this->_field]['name'] = [$this->_data[$this->_field]['name']];
                        }

                        foreach ($this->_data[$this->_field]['name'] as $value) {
                            if ($value != '') {
                                if (!in_array(pathinfo($value)['extension'], $constraint['value'])) {
                                    array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                                }
                            }
                        }
                        break;

                    case self::SIZEMIN:
                        if (!is_array($this->_data[$this->_field]['size'])) {
                            $this->_data[$this->_field]['size'] = [$this->_data[$this->_field]['size']];
                        }

                        foreach ($this->_data[$this->_field]['size'] as $value) {
                            if ($value != 0) {
                                if ($value < $constraint['value']) {
                                    array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                                }
                            }
                        }
                        break;

                    case self::SIZEMAX:
                        if (!is_array($this->_data[$this->_field]['size'])) {
                            $this->_data[$this->_field]['size'] = [$this->_data[$this->_field]['size']];
                        }

                        foreach ($this->_data[$this->_field]['size'] as $value) {
                            if ($value != 0) {
                                if ($value > $constraint['value']) {
                                    array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                                }
                            }
                        }
                        break;

                    case self::SIZEBETWEEN:
                        if (!is_array($this->_data[$this->_field]['size'])) {
                            $this->_data[$this->_field]['size'] = [$this->_data[$this->_field]['size']];
                        }

                        foreach ($this->_data[$this->_field]['size'] as $value) {
                            if ($value != 0) {
                                if ($value < $constraint['value'][0] || $value > $constraint['value'][1]) {
                                    array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                                }
                            }
                        }
                        break;

                    case self::COUNT:
                        if (!is_array($this->_data[$this->_field]['name'])) {
                            $this->_data[$this->_field]['name'] = [$this->_data[$this->_field]['name']];
                        }

                        if (count($this->_data[$this->_field]['name']) != $constraint['value']) {
                            array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                        }
                        break;

                    case self::COUNTMIN:
                        if (!is_array($this->_data[$this->_field]['name'])) {
                            $this->_data[$this->_field]['name'] = [$this->_data[$this->_field]['name']];
                        }

                        if (count($this->_data[$this->_field]['name']) < $constraint['value']) {
                            array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                        }
                        break;

                    case self::COUNTMAX:
                        if (!is_array($this->_data[$this->_field]['name'])) {
                            $this->_data[$this->_field]['name'] = [$this->_data[$this->_field]['name']];
                        }

                        if (count($this->_data[$this->_field]['name']) > $constraint['value']) {
                            array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                        }
                        break;

                    case self::COUNTIN:
                        if (!is_array($this->_data[$this->_field]['name'])) {
                            $this->_data[$this->_field]['name'] = [$this->_data[$this->_field]['name']];
                        }

                        if (!in_array(count($this->_data[$this->_field]['name']), $constraint['value'])) {
                            array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraint['message']]);
                        }
                        break;

                    case self::CUSTOM:
                        /** @var object[] $constraints */
                        if ($constraints['value']->filter() == false) {
                            array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['value']->error()]);
                        }
                        break;
                }
            }
        }
    }
122197
@Check(CheckType.FAST)
	public void checkSuperTypes(SarlCapacity capacity) {
		checkSuperTypes(
				capacity,
				SARL_CAPACITY__EXTENDS,
				capacity.getExtends(),
				Capacity.class,
				false);
	}
1032157
@Check(CheckType.FAST)
	public void checkSuperType(SarlAgent agent) {
		checkSuperTypes(
				agent,
				SARL_AGENT__EXTENDS,
				Utils.singletonList(agent.getExtends()),
				Agent.class,
				false);
	}
20029
def _walk_for_type(self, check_type):
        """"""
        for class_name, properties in sorted(self.resources.items()):
            for key, value in sorted(properties.items()):
                if self._check_type(check_type, value):
                    return True
        for class_name, properties in sorted(self.properties.items()):
            for key, value in sorted(properties.items()):
                if self._check_type(check_type, value):
                    return True

        return False
1130065
def check(self):
        
        super(NestedSetting, self).check()
        errors = []
        for subsetting in self.settings.values():
            try:
                subsetting.check()
            except ValidationError as error:
                errors.extend(error.messages)
        if errors:
            raise ValidationError(errors)
1129811
def _Verify(self):
    

    # If the list of expected calls is not empty, raise an exception
    if self._expected_calls_queue:
      # The last MultipleTimesGroup is not popped from the queue.
      if (len(self._expected_calls_queue) == 1 and
          isinstance(self._expected_calls_queue[0], MultipleTimesGroup) and
          self._expected_calls_queue[0].IsSatisfied()):
        pass
      else:
        raise ExpectedMethodCallsError(self._expected_calls_queue)
886582
def check_condition(condition, caller)
      Watir.logger.debug "<- `Verifying precondition #{inspect}##{condition} for #{caller}`"
      begin
        condition.nil? ? assert_exists : send(condition)
        Watir.logger.debug "<- `Verified precondition #{inspect}##{condition || 'assert_exists'}`"
      rescue unknown_exception
        raise unless condition.nil?

        Watir.logger.debug "<- `Unable to satisfy precondition #{inspect}##{condition}`"
        check_condition(:wait_for_exists, caller)
      end
    end
1214418
@Override
    protected void checkType() {
        if (!isDependent() && getEnhancedAnnotated().isParameterizedType()) {
            throw BeanLogger.LOG.managedBeanWithParameterizedBeanClassMustBeDependent(type);
        }
        boolean passivating = beanManager.isPassivatingScope(getScope());
        if (passivating && !isPassivationCapableBean()) {
            if (!getEnhancedAnnotated().isSerializable()) {
                throw BeanLogger.LOG.passivatingBeanNeedsSerializableImpl(this);
            } else if (hasDecorators() && !allDecoratorsArePassivationCapable()) {
                throw BeanLogger.LOG.passivatingBeanHasNonPassivationCapableDecorator(this, getFirstNonPassivationCapableDecorator());
            } else if (hasInterceptors() && !allInterceptorsArePassivationCapable()) {
                throw BeanLogger.LOG.passivatingBeanHasNonPassivationCapableInterceptor(this, getFirstNonPassivationCapableInterceptor());
            }
        }
    }
1255379
def success(self):
        """"""
        self._check_valid()
        return self._problem._p.get_status() == qsoptex.SolutionStatus.OPTIMAL
1171361
def is_condition_met(self, hand, *args):
        
        indices = reduce(lambda z, y: z + y, hand)
        return all(x in HONOR_INDICES for x in indices)
616480
def check_types(key='root', expected=TYPES, actual=self, opts={})
      bad_type(key, expected, actual, opts) unless actual.is_a? expected.class
      case actual
      when Hash then actual.each { |k, v| check_types(k, expected[k], v) }
      when Enumerable then actual.each { |v| check_types(key, expected.first, v, enum: true) }
      end
    end
403136
def validate(self, *args, **kwds):
        
        if self.behavior:
            return self.behavior.validate(self, *args, **kwds)
        return True
125420
def _check_type(self, check_type, properties):
        """"""
        if 'PrimitiveType' in properties:
            return properties['PrimitiveType'] == check_type
        if properties['Type'] == 'List':
            if 'ItemType' in properties:
                return properties['ItemType'] == check_type
            else:
                return properties['PrimitiveItemType'] == check_type
        return False
816136
protected static function checkRequirements()
    {
        if (empty(self::$enabledTypes)) {
            self::$enabledTypes[self::ZIP] = extension_loaded('zip');
            self::$enabledTypes[self::SEVEN_ZIP] = class_exists('\Archive7z\Archive7z');
            self::$enabledTypes[self::RAR] = extension_loaded('rar');
            self::$enabledTypes[self::GZIP] = extension_loaded('zlib');
            self::$enabledTypes[self::BZIP] = extension_loaded('bz2');
            self::$enabledTypes[self::LZMA] = extension_loaded('xz');
            self::$enabledTypes[self::ISO] = class_exists('\CISOFile');
            self::$enabledTypes[self::CAB] = class_exists('\CabArchive');
            self::$enabledTypes[self::TAR] = class_exists('\Archive_Tar') || class_exists('\PharData');
            self::$enabledTypes[self::TAR_GZIP] = (class_exists('\Archive_Tar') || class_exists('\PharData')) && extension_loaded('zlib');
            self::$enabledTypes[self::TAR_BZIP] = (class_exists('\Archive_Tar') || class_exists('\PharData')) && extension_loaded('bz2');
            self::$enabledTypes[self::TAR_LZMA] = class_exists('\Archive_Tar') && extension_loaded('lzma2');
            self::$enabledTypes[self::TAR_LZMA] = class_exists('\Archive_Tar') && LzwStreamWrapper::isBinaryAvailable();
        }
    }