Add gridy=RELATIVE to the constraints for the current component if how ==
true 0 it if false.
341922
public Packer setYTopRelative(final boolean how) {
        if (how == true) {
            gc.gridy = GridBagConstraints.RELATIVE;
        } else {
            gc.gridy = 0;
        }
        setConstraints(comp, gc);
        return this;
    }
1357055
public Packer setFillY(final boolean how) {
        if (how == true) {
            gc.fill = GridBagConstraints.VERTICAL;
            gc.weighty = 1;
        } else {
            gc.weighty = 0;
            gc.fill = 0;
        }
        setConstraints(comp, gc);
        return this;
    }
1198123
public Packer setRemainX(final boolean how) {
        if (how == true) {
            gc.gridwidth = GridBagConstraints.REMAINDER;
        } else {
            gc.gridwidth = 1;
        }
        setConstraints(comp, gc);
        return this;
    }
1042687
def add(self, *args):
        """"""
        self._constrs.extend(self._moma._prob.add_linear_constraints(*args))
435378
public void addCell(TableLayoutCell cell) {
        GridBagConstraints constraints = cell.getConstraints();
        constraints.insets = new Insets(cellpadding, cellpadding, cellpadding, cellpadding);
        add(cell.getComponent(), constraints);
    }
814516
def show_grid(self, **kwargs):
        
        kwargs.setdefault('grid', 'back')
        kwargs.setdefault('location', 'outer')
        kwargs.setdefault('ticks', 'both')
        return self.show_bounds(**kwargs)
1132060
public void setInitialConstraintsFrom(final Component comp) {
        gc = getConstraints(comp);
        if (gc == null) {
            throw new IllegalArgumentException(comp + " has no existing constraints");
        }
        setConstraints(comp, gc);
    }
859790
public function addConstraints()
    {
        $this->query->where($this->foreignKey, '=', $this->parent->{$this->localKey});
    }
720106
def _add_constraint(self, constraint):
        
        constraint_data = self.data['probnet']['AdditionalConstraints'][constraint]
        constraint_element = etree.SubElement(
            self.additional_constraints, 'Constraint', attrib={'name': constraint})
        for argument in sorted(constraint_data):
            name = argument
            value = constraint_data[name]
            etree.SubElement(constraint_element, 'Argument', attrib={'name': name, 'value': value})
201728
private static GridBagConstraints getConstraints(int gridx, int gridy, int gridwidth) {
        GridBagConstraints gc = new GridBagConstraints();
        gc.fill = GridBagConstraints.NONE;
        gc.anchor = GridBagConstraints.WEST;
        gc.gridx = gridx;
        gc.gridy = gridy;
        gc.gridwidth = gridwidth;
        return gc;
    }
204780
public void addAlphaConstraint(AlphaNodeFieldConstraint constraint) {
        if ( constraint != null ) {
            AlphaNodeFieldConstraint[] tmp = this.alphaConstraints;
            this.alphaConstraints = new AlphaNodeFieldConstraint[tmp.length + 1];
            System.arraycopy( tmp,
                              0,
                              this.alphaConstraints,
                              0,
                              tmp.length );
            this.alphaConstraints[this.alphaConstraints.length - 1] = constraint;
            this.updateRequiredDeclarations( constraint );
        }
    }
1292242
def satisfies_constraints(self, possible_solution):
        """"""
        for c in self._constraints:
            values = c.extract_values(possible_solution)
            if values is None or not c(*values):
                return False
        return True
982459
public PropertyConstraint ifTrue(PropertyConstraint ifConstraint, PropertyConstraint[] thenConstraints,
			PropertyConstraint[] elseConstraints) {
		return new ConditionalPropertyConstraint(ifConstraint,
				new CompoundPropertyConstraint(new And(thenConstraints)), new CompoundPropertyConstraint(new And(
						elseConstraints)));
	}
136408
public Packer setAnchorWest(final boolean how) {
        if (how == true) {
            gc.anchor = GridBagConstraints.WEST;
        } else {
            gc.anchor &= ~GridBagConstraints.WEST;
        }
        setConstraints(comp, gc);
        return this;
    }
520689
def _constraint(self, params):
        
        if (params["spin1x"]**2 + params["spin1y"]**2 +
                params["spin1z"]**2)**2 > 1:
            return False
        elif (params["spin2x"]**2 + params["spin2y"]**2 +
                  params["spin2z"]**2)**2 > 1:
            return False
        else:
            return True
1366279
def _add_constraints(self):
    """"""
    # Add operation constraints.
    for mesh_dimension_name in (
        self._layout_validator.mesh_dimension_name_to_size):
      for mtf_dimension_set in self._operation_mtf_dimension_sets:
        self._model.Add(
            sum(self._global_vars[(mtf_dimension_name, mesh_dimension_name)]
                for mtf_dimension_name in mtf_dimension_set) <= 1)

    # Add global constraints.
    for mtf_dimension_name in (
        self._layout_validator.splittable_mtf_dimension_names):
      self._model.Add(
          sum(self._global_vars[(mtf_dimension_name, mesh_dimension_name)]
              for mesh_dimension_name in (
                  self._layout_validator.mesh_dimension_name_to_size)) <= 1)

    # Add divisibility constraints.
    for mtf_dimension_name in (
        self._layout_validator.splittable_mtf_dimension_names):
      for mesh_dimension_name in (
          self._layout_validator.mesh_dimension_name_to_size):
        if not self._layout_validator.is_valid_assignment(mtf_dimension_name,
                                                          mesh_dimension_name):
          self._model.Add(self._global_vars[(mtf_dimension_name,
                                             mesh_dimension_name)] == 0)

    # Add local constraints.
    for mtf_dimension_set in self._mtf_dimension_sets:
      self._model.Add(
          sum(self._local_vars[mtf_dimension_set][_local_var_name(
              mtf_dimension_set, assignment)]
              for assignment in self._assignments[mtf_dimension_set]) == 1)

    # Add local-to-global constraints.
    for mtf_dimension_set in self._mtf_dimension_sets:
      for assignment in self._assignments[mtf_dimension_set]:
        name = _local_var_name(mtf_dimension_set, assignment)
        for mtf_dimension_name in mtf_dimension_set:
          if mtf_dimension_name in assignment:
            mesh_dimension_name = assignment[mtf_dimension_name]
            self._model.AddImplication(
                self._local_vars[mtf_dimension_set][name],
                self._global_vars[(mtf_dimension_name, mesh_dimension_name)])
          else:
            for mesh_dimension_name in (
                self._layout_validator.mesh_dimension_name_to_size):
              self._model.AddImplication(
                  self._global_vars[(mtf_dimension_name, mesh_dimension_name)],
                  self._local_vars[mtf_dimension_set][name].Not())

    # Add memory constraints.
    tensor_memory_sum = {}
    for tensor_name in self._graph.get_all_tensor_names():
      tensor_memory_sum[tensor_name] = 0
      mtf_dimension_set = self._tensor_name_to_mtf_dimension_set[tensor_name]

      if not self._graph.is_tensor_on_canonical_device(tensor_name):
        continue

      for assignment in self._assignments[mtf_dimension_set]:
        size_under_assignment = self._graph.get_tensor_size(
            tensor_name, assignment,
            self._layout_validator.mesh_dimension_name_to_size)

        name = _local_var_name(mtf_dimension_set, assignment)
        tensor_memory_sum[tensor_name] += (
            size_under_assignment * self._local_vars[mtf_dimension_set][name])

    for tensor_names in self._get_memory_contents():
      self._model.Add(
          sum(tensor_memory_sum[tensor_name]
              for tensor_name in tensor_names) <= self._memory_var)
80632
public Packer setRemainY(final boolean how) {
        if (how == true) {
            gc.gridheight = GridBagConstraints.REMAINDER;
        } else {
            gc.gridheight = 1;
        }
        setConstraints(comp, gc);
        return this;
    }