Checks the constraints.

        :param pkge: the package to check
        :type pkge: Package
        :param constr: the package constraint to check
        :type constr: PackageConstraint
498358
def check_constraint(self, pkge=None, constr=None):
        
        if not pkge is None:
            return javabridge.call(
                self.jobject, "checkConstraint", "(Lweka/core/packageManagement/Package;)Z", pkge.jobject)
        if not constr is None:
            return javabridge.call(
                self.jobject, "checkConstraint", "(Lweka/core/packageManagement/PackageConstraint;)Z", pkge.jobject)
        raise Exception("Either package or package constraing must be provided!")
190463
def no_constraints(cls, with_subclasses=False):
        
        cls._constraints = False

        if with_subclasses:
            for klass in cls.__subclasses__():
                klass._constraints = False

        try:
            yield cls
        except Exception:
            raise
        finally:
            cls._constraints = True
            if with_subclasses:
                for klass in cls.__subclasses__():
                    klass._constraints = True
1320066
public void check(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
    {
        ensureColumn(fieldDef, checkLevel);
        ensureJdbcType(fieldDef, checkLevel);
        ensureConversion(fieldDef, checkLevel);
        ensureLength(fieldDef, checkLevel);
        ensurePrecisionAndScale(fieldDef, checkLevel);
        checkLocking(fieldDef, checkLevel);
        checkSequenceName(fieldDef, checkLevel);
        checkId(fieldDef, checkLevel);
        if (fieldDef.isAnonymous())
        {
            checkAnonymous(fieldDef, checkLevel);
        }
        else
        {
            checkReadonlyAccessForNativePKs(fieldDef, checkLevel);
        }
    }
1122293
def add_constraints(self):
        
        if self._constraints:
            self._query.where(self._foreign_key, "=", self.get_parent_key())
1222305
public boolean hasConstraint (int tileIdx, String constraint)
    {
        return (_bits == null || _bits[tileIdx].constraints == null) ? false :
            ListUtil.contains(_bits[tileIdx].constraints, constraint);
    }
416010
public boolean hasConstraint (String constraint)
    {
        return (_constraints == null) ? false :
            ListUtil.contains(_constraints, constraint);
    }
78379
def add(self, *constraints):
        
        cc = self._adjust_constraint_list(constraints)
        return self._solver.add(cc)
506377
def constraint_from_type(cls, value):
        
        if value is None:
            return None
        value_type = type(value)
        if value_type in (str, int, bool):
            return value_type
        raise ParameterError('Parameter type cannot be %s' % value_type)
45607
def add_constraint(constr)
      terms = constr.expression.terms
      indexes_buffer = build_pointer_array(terms.each_key.map do |var|
        var.index
      end, :int)
      values_buffer = build_pointer_array terms.values, :double

      ret = Gurobi.GRBaddconstr @ptr, terms.length,
                                indexes_buffer, values_buffer,
                                gurobi_sense(constr.sense),
                                constr.rhs, constr.name
      fail if ret != 0

      constr.model = self
      constr.index = @constraints.length
      constr.freeze
      @constraints << constr
    end
1170453
function checkPkg(pkgDir, scopes) {
  var errors;
  try {
    var config = {packageDir: pkgDir};
    if (scopes) {
      config.scopeList = scopes;
    }
    var checked = checkDeps.sync(config);
    if (checked.error.length) {
      errors = checked.error;
    }
  } finally {
    // eslint-disable-next-line no-unsafe-finally
    return errors;
  }
}
817212
public void check(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
    {
        ensureNoTableInfoIfNoRepositoryInfo(classDef, checkLevel);
        checkModifications(classDef, checkLevel);
        checkExtents(classDef, checkLevel);
        ensureTableIfNecessary(classDef, checkLevel);
        checkFactoryClassAndMethod(classDef, checkLevel);
        checkInitializationMethod(classDef, checkLevel);
        checkPrimaryKey(classDef, checkLevel);
        checkProxyPrefetchingLimit(classDef, checkLevel);
        checkRowReader(classDef, checkLevel);
        checkObjectCache(classDef, checkLevel);
        checkProcedures(classDef, checkLevel);
    }
680865
def _constrain(value, lb=0, ub=1):
    """"""
    if value < lb:
        return lb
    elif value > ub:
        return ub
    else:
        return value
820429
boolean checkInputDependencyConstraints() {
		if (getInputDependencyConstraint() == InputDependencyConstraint.ANY) {
			// InputDependencyConstraint == ANY
			return IntStream.range(0, inputEdges.length).anyMatch(this::isInputConsumable);
		} else {
			// InputDependencyConstraint == ALL
			return IntStream.range(0, inputEdges.length).allMatch(this::isInputConsumable);
		}
	}
317312
def format_python_constraint(constraint):
    
    if isinstance(constraint, Version):
        if constraint.precision >= 3:
            return "=={}".format(str(constraint))

        # Transform 3.6 or 3
        if constraint.precision == 2:
            # 3.6
            constraint = parse_constraint(
                "~{}.{}".format(constraint.major, constraint.minor)
            )
        else:
            constraint = parse_constraint("^{}.0".format(constraint.major))

    if not isinstance(constraint, VersionUnion):
        return str(constraint)

    formatted = []
    accepted = []

    for version in PYTHON_VERSION:
        version_constraint = parse_constraint(version)
        matches = constraint.allows_any(version_constraint)
        if not matches:
            formatted.append("!=" + version)
        else:
            accepted.append(version)

    # Checking lower bound
    low = accepted[0]

    formatted.insert(0, ">=" + ".".join(low.split(".")[:2]))

    return ", ".join(formatted)
677835
def constraints(self):
        
        try:
            return self._constraints
        except AttributeError:
            self._constraints = ConstraintDict()
            return self._constraints
1089616
def _config_parser_constrained(self, read_only):
        """"""
        try:
            pc = self.parent_commit
        except ValueError:
            pc = None
        # end handle empty parent repository
        parser = self._config_parser(self.repo, pc, read_only)
        parser.set_submodule(self)
        return SectionConstraint(parser, sm_section(self.name))
1041775
def check_python_import(package_or_module):
    '''
    
    '''
    logger = logging.getLogger(__name__)
    logger.debug("Checking python import '%s'...", package_or_module)
    loader = pkgutil.get_loader(package_or_module)
    found = loader is not None
    if found:
        logger.debug("Python %s '%s' found",
                     "package" if loader.is_package(package_or_module)
                     else "module", package_or_module)
    else:  # pragma: no cover
        logger.debug("Python import '%s' not found", package_or_module)
    return found