Runs a callback with constraints disabled on the relation.
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
820903
public function addConstraints()
    {
        $parentTable = $this->parent->getTable();

        $this->setJoin();
        if (static::$constraints && !$this->throughKey) {
            $localValue = $this->farParent[$this->localKey];
            $this->query->where($parentTable.'.'.$this->firstKey, '=', $localValue);
        } else {
            $localValue = $this->farParent['id'];
            $this->query->where($this->firstKey . '.' . $this->farParentRelatedKey, '=', $localValue);
        }

    }
192650
def _load_relation(self, models, name, constraints):
        
        relation = self.get_relation(name)

        relation.add_eager_constraints(models)

        if callable(constraints):
            constraints(relation)
        else:
            relation.merge_query(constraints)

        models = relation.init_relation(models, name)

        results = relation.get_eager()

        return relation.match(models, results, name)
822221
def on_excepthandler(self, node):  # ('type', 'name', 'body')
        """"""
        return (self.run(node.type), node.name, node.body)
533262
public function addConstraints()
    {
        $parentTable = $this->parentMap->getTable();

        $this->setJoin();

        if (static::$constraints) {
            $farParentKeyName = $this->farParentMap->getKeyName();

            $this->query->where(
                $parentTable.'.'.$this->firstKey,
                '=',
                $this->farParent->getEntityAttribute($farParentKeyName)
            );
        }
    }
473744
public final void setConstraints(@NonNull final Constraint<Type>[] constraints) {
        Condition.INSTANCE.ensureNotNull(constraints, "The constraints may not be null");
        Condition.INSTANCE.ensureAtLeast(constraints.length, 1, "The constraints may not be empty");
        this.constraints = constraints;
    }
161271
function handler(instance, context, func, index, callback) {
	return function() {
		var old = instance.results[index];
		instance.results[index] = tryExpr(func, context);
		if (old === instance.results[index])
			return;
		if (instance.dependenciesCount === 1 || !Interpolable.allowDelayedUpdate)
			callback(instance.output(context), 'set');
		else if (!instance.willFire)
			instance.willFire = context.delay(function() { // call on nextTick to manage other dependencies update without multiple rerender
				if (instance.willFire) {
					instance.willFire = null;
					callback(instance.output(context), 'set');
				}
			}, 0);
	};
}
664227
function Constraint(left_op, right_op, isList) {
  this.left = left_op;
  this.right = right_op;
  this.isList = false;
  if (isList) {
    this.isList = isList;
  }
}
380184
public function addConstraints()
    {
        if (static::$constraints) {
            $table = $this->related->getTable();

            $this->query->where($table.'.'.$this->otherKey, '=', $this->parent->{$this->foreignKey});
        }
    }
876734
def constrain_property(self,prop,**kwargs):
        
        if prop not in self.constraints:
            self.constraints.append(prop)
        for pop in self.poplist:
            try:
                pop.constrain_property(prop,**kwargs)
            except AttributeError:
                logging.info('%s model does not have property stars.%s (constraint not applied)' % (pop.model,prop))
1122293
def add_constraints(self):
        
        if self._constraints:
            self._query.where(self._foreign_key, "=", self.get_parent_key())
627167
def drop_constraints(quiet=True, stdout=None):
    

    results, meta = db.cypher_query("CALL db.constraints()")
    pattern = re.compile(':(.*) \).*\.(\w*)')
    for constraint in results:
        db.cypher_query('DROP ' + constraint[0])
        match = pattern.search(constraint[0])
        stdout.write(''' - Droping unique constraint and index on label {0} with property {1}.\n'''.format(
            match.group(1), match.group(2)))
    stdout.write("\n")
680865
def _constrain(value, lb=0, ub=1):
    """"""
    if value < lb:
        return lb
    elif value > ub:
        return ub
    else:
        return value
345933
function handleStart(context) {

    var resizeConstraints = context.resizeConstraints,
        // evaluate minBounds for backwards compatibility
        minBounds = context.minBounds;

    if (resizeConstraints !== undefined) {
      return;
    }

    if (minBounds === undefined) {
      minBounds = self.computeMinResizeBox(context);
    }

    context.resizeConstraints = {
      min: asTRBL(minBounds)
    };
  }
1357734
def constrain_negative(self, warning=True, trigger_parent=True):
        
        self.constrain(NegativeLogexp(), warning=warning, trigger_parent=trigger_parent)
247191
def relation_call(method, relation_name=None, flag=None, state=None, *args):
    """"""
    if relation_name:
        relation = relation_from_name(relation_name)
        if relation is None:
            raise ValueError('Relation not found: %s' % relation_name)
    elif flag or state:
        relation = relation_from_flag(flag or state)
        if relation is None:
            raise ValueError('Relation not found: %s' % (flag or state))
    else:
        raise ValueError('Must specify either relation_name or flag')
    result = getattr(relation, method)(*args)
    if isinstance(relation, RelationBase) and method == 'conversations':
        # special case for conversations to make them work from CLI
        result = [c.scope for c in result]
    return result
527630
public function addConstraints()
    {
        $throughValue = $this->farChild[$this->secondKey];

        $this->performJoin();

        if (static::$constraints) {
            $this->query->where($this->getQualifiedSecondOwnerKeyName(), '=', $throughValue);
        }

    }