nodeConstraint: valueSet xsFacet* #nodeConstraintValueSet
506316
def visitNodeConstraintValueSet(self, ctx: ShExDocParser.NodeConstraintValueSetContext):
        
        self.nodeconstraint.values = []
        self.visitChildren(ctx)
670146
def set(self, x):
        
        for name, value in iter(x.items()):
            if hasattr(value, "ndim"):
                if self[name].value.ndim < value.ndim:
                    self[name].value.itemset(value.squeeze())
                else:
                    self[name].value = value
            else:
                self[name].value.itemset(value)
957289
OrderedHashSet getDependentConstraints(int colIndex) {

        OrderedHashSet set = new OrderedHashSet();

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.hasColumnOnly(colIndex)) {
                set.add(c);
            }
        }

        return set;
    }
675567
private final ValueNode registerFinalValue(int value) {
        // We always register final values because while ADDING
        // we do not know yet whether we will build fast or small.
        lookupFinalValueNode.setFinalValue(value);
        Node oldNode=nodes.get(lookupFinalValueNode);
        if(oldNode!=null) {
            return (ValueNode)oldNode;
        }
        ValueNode newNode=new ValueNode(value);
        // If put() returns a non-null value from an equivalent, previously
        // registered node, then get() failed to find that and we will leak newNode.
        oldNode=nodes.put(newNode, newNode);
        assert(oldNode==null);
        return newNode;
    }
380865
def visitNodeConstraintLiteral(self, ctx: ShExDocParser.NodeConstraintLiteralContext):
        
        self.nodeconstraint.nodeKind = 'literal'
        self.visitChildren(ctx)
701885
def value_index(idx)
      node = self
      while node.parent
        idx += node.parent.offsets[node.index_in_parent_node]
        node = node.parent
      end

      idx
    end
330585
def setValue(self, key, value):
        
        parts = nativestring(key).split('/')
        curr = self._xstack[-1]
        for part in parts[:-1]:
            next = curr.find(part)
            if next is None:
                next = ElementTree.SubElement(curr, part)
            curr = next
        
        xval = curr.find(parts[-1])
        if xval is None:
            xval = ElementTree.SubElement(curr, parts[-1])
        
        self.storeValue(xval, value)
83955
def node_val_set(self, graph, node, key, branch, turn, tick, value):
        """"""
        if (branch, turn, tick) in self._btts:
            raise TimeError
        self._btts.add((branch, turn, tick))
        graph, node, key, value = map(self.pack, (graph, node, key, value))
        self._nodevals2set.append((graph, node, key, branch, turn, tick, value))
672515
function setConstraints(oType, oConstraints) {
		var vNullable,
			iPrecision;

		oType.oConstraints = undefined;
		if (oConstraints) {
			vNullable = oConstraints.nullable;
			if (vNullable === false || vNullable === "false") {
				oType.oConstraints = {nullable : false};
			} else if (vNullable !== undefined && vNullable !== true && vNullable !== "true") {
				Log.warning("Illegal nullable: " + vNullable, null, oType.getName());
			}

			if (oConstraints.isDateOnly === true) {
				oType.oConstraints = oType.oConstraints || {};
				oType.oConstraints.isDateOnly = true;
			}

			iPrecision = oConstraints.precision;
			if (iPrecision !== undefined) {
				if (iPrecision === Math.floor(iPrecision) && iPrecision >= 1 && iPrecision <= 12) {
					oType.oConstraints = oType.oConstraints || {};
					oType.oConstraints.precision = iPrecision;
				} else if (iPrecision !== 0) {
					Log.warning("Illegal precision: " + iPrecision, null, oType.getName());
				} // else: 0 is the default!
			}
		}
		oType._handleLocalizationChange();
	}
1242282
Expression XreadExplicitRowValueConstructorOrNull() {

        Expression e;

        switch (token.tokenType) {

            case Tokens.OPENBRACKET : {
                read();

                int position = getPosition();
                int brackets = readOpenBrackets();

                switch (token.tokenType) {

                    case Tokens.TABLE :
                    case Tokens.VALUES :
                    case Tokens.SELECT :
                        rewind(position);

                        SubQuery sq = XreadSubqueryBody(false,
                                                        OpTypes.ROW_SUBQUERY);

                        readThis(Tokens.CLOSEBRACKET);

                        return new Expression(OpTypes.ROW_SUBQUERY, sq);

                    default :
                        rewind(position);

                        e = XreadRowElementList(true);

                        readThis(Tokens.CLOSEBRACKET);

                        return e;
                }
            }
            case Tokens.ROW : {
                read();
                readThis(Tokens.OPENBRACKET);

                e = XreadRowElementList(false);

                readThis(Tokens.CLOSEBRACKET);

                return e;
            }
        }

        return null;
    }
911245
private Set<ConstraintViolation<Object>> addViolations(
            Set<ConstraintViolation<Object>> source,
            Set<ConstraintViolation<Object>> target) {
        if (supportsConstraintComposition) {
            target.addAll(source);
            return target;
        }

        for (final Iterator<ConstraintViolation<Object>> iter = source
                .iterator(); iter.hasNext(); ) {
            final ConstraintViolation<Object> violation = iter.next();
            final Iterator<Node> nodeIter = violation.getPropertyPath()
                    .iterator();

			/*
			 * Only include violations that have no property path or just one
			 * node
			 */
            if (!nodeIter.hasNext()
                    || (nodeIter.next() != null && !nodeIter.hasNext())) {
                target.add(violation);
            }
        }

        return target;
    }
800560
def constraint_join(cfg_nodes):
    """"""
    r = 0
    for e in cfg_nodes:
        r = r | constraint_table[e]
    return r
1239334
public XSDocument constraint(Constraint constraint, String constraintValue) throws SAXException{
        if(constraint!=Constraint.NONE)
            xml.addAttribute(constraint.name().toLowerCase(), constraintValue);
        return this;
    }
663137
def withNamedValues(cls, **values):
        
        enums = set(cls.namedValues.items())
        enums.update(values.items())

        class X(cls):
            namedValues = namedval.NamedValues(*enums)
            subtypeSpec = cls.subtypeSpec + constraint.SingleValueConstraint(
                *values.values())

        X.__name__ = cls.__name__

        return X
470226
public boolean isInValueSet(Value value) {
        if (value == null) {
            throw new IllegalArgumentException("value cannot be null");
        }

        boolean result = true;
        if (!this.valuesKeySet.isEmpty()) {
            result = this.valuesKeySet.contains(value);
        } else if (this.lowerBound != null || this.upperBound != null) {
            if (this.lowerBound != null
                    && !ValueComparator.GREATER_THAN_OR_EQUAL_TO.compare(
                    value, this.lowerBound)) {
                result = false;
            }
            if (this.upperBound != null
                    && !ValueComparator.LESS_THAN_OR_EQUAL_TO.compare(
                    value, this.upperBound)) {
                result = false;
            }
        }
        return result;
    }
1177889
def do_node_set(self, element, decl, pseudo):
        """"""
        target = serialize(decl.value).strip()
        step = self.state[self.state['current_step']]
        elem = self.current_target().tree
        _, valstep = self.lookup('pending', target)
        if not valstep:
            step['pending'][target] = [('nodeset', elem)]
        else:
            self.state[valstep]['pending'][target] = [('nodeset', elem)]
571601
private Stream<IndexConstraintNodeInfo> indexesAndConstraintsForNode(Map<String,Object> config) {

        SchemaConfig schemaConfig = new SchemaConfig(config);
        Set<String> includeLabels = schemaConfig.getLabels();
        Set<String> excludeLabels = schemaConfig.getExcludeLabels();

        try ( Statement ignore = tx.acquireStatement() ) {
            TokenRead tokenRead = tx.tokenRead();
            TokenNameLookup tokens = new SilentTokenNameLookup(tokenRead);

            SchemaRead schemaRead = tx.schemaRead();
            Iterable<IndexReference> indexesIterator;
            Iterable<ConstraintDescriptor> constraintsIterator;

            if (includeLabels.isEmpty()) {
                Iterable<IndexReference> allIndex = () -> schemaRead.indexesGetAll();
                indexesIterator = StreamSupport.stream(allIndex.spliterator(),false)
                        .filter(index -> Arrays.stream(index.schema().getEntityTokenIds()).noneMatch(id -> {
                            try {
                                return excludeLabels.contains(tokenRead.nodeLabelName(id));
                            } catch (LabelNotFoundKernelException e) {
                                return false;
                            }
                        })).collect(Collectors.toList());

                Iterable<ConstraintDescriptor> allConstraints = () -> schemaRead.constraintsGetAll();
                constraintsIterator = StreamSupport.stream(allConstraints.spliterator(),false)
                        .filter(constraint -> Arrays.stream(constraint.schema().getEntityTokenIds()).noneMatch(id -> {
                            try {
                                return excludeLabels.contains(tokenRead.nodeLabelName(id));
                            } catch (LabelNotFoundKernelException e) {
                                return false;
                            }
                            }))
                            .collect(Collectors.toList());
            } else {
                constraintsIterator = includeLabels.stream()
                        .filter(label -> !excludeLabels.contains(label) && tokenRead.nodeLabel(label) != -1)
                        .flatMap(label -> {
                            Iterable<ConstraintDescriptor> indexesForLabel = () -> schemaRead.constraintsGetForLabel(tokenRead.nodeLabel(label));
                            return StreamSupport.stream(indexesForLabel.spliterator(), false);
                        })
                        .collect(Collectors.toList());

                indexesIterator = includeLabels.stream()
                        .filter(label -> !excludeLabels.contains(label) && tokenRead.nodeLabel(label) != -1)
                        .flatMap(label -> {
                            Iterable<IndexReference> indexesForLabel = () -> schemaRead.indexesGetForLabel(tokenRead.nodeLabel(label));
                            return StreamSupport.stream(indexesForLabel.spliterator(), false);
                        })
                        .collect(Collectors.toList());
            }


            Stream<IndexConstraintNodeInfo> constraintNodeInfoStream = StreamSupport.stream(constraintsIterator.spliterator(), false)
                    .filter(constraintDescriptor -> constraintDescriptor.type().equals(ConstraintDescriptor.Type.EXISTS))
                    .map(constraintDescriptor -> this.nodeInfoFromConstraintDescriptor(constraintDescriptor, tokens))
                    .sorted(Comparator.comparing(i -> i.label));

            Stream<IndexConstraintNodeInfo> indexNodeInfoStream = StreamSupport.stream(indexesIterator.spliterator(), false)
                    .map(indexReference -> this.nodeInfoFromIndexDefinition(indexReference, schemaRead, tokens))
                    .sorted(Comparator.comparing(i -> i.label));

            return Stream.of(constraintNodeInfoStream, indexNodeInfoStream).flatMap(e -> e);
        }
    }