Sets the fold trigger state (collapsed or expanded).

        :param block: The block to modify
        :param val: The new trigger state (True=collapsed, False=expanded)
185648
def set_collapsed(block, val):
        
        if block is None:
            return
        state = block.userState()
        if state == -1:
            state = 0
        state &= 0x77FFFFFF
        state |= int(val) << 27
        block.setUserState(state)
977987
public Packer setInsetRight(final int val) {
        Insets i = gc.insets;
        if (i == null) {
            i = new Insets(0, 0, 0, 0);
        }
        gc.insets = new Insets(i.top, i.left, i.bottom, val);
        setConstraints(comp, gc);
        return this;
    }
303787
def mousePressEvent(self, event):
        """"""
        if self._mouse_over_line is not None:
            block = self.editor.document().findBlockByNumber(
                self._mouse_over_line)
            self.toggle_fold_trigger(block)
180125
def configure(*val , &block)
      case val.size
      when 1
        return @config[val[0]]
      when 2
        @config[val[0]] = val[1]
        instance_variable_set("@#{val[0]}", val[1]) 
      end
      instance_eval &block if block_given?
    end
536761
function newSelector($block, multiple, type){
			var selector = new jqCronSelector(_self, $block, multiple, type);
			selector.$.bind('selector:open', function(){
				// we close all opened selectors of all other jqCron
				for(var n = jqCronInstances.length; n--; ){
					if(jqCronInstances[n] != _self) {
						jqCronInstances[n].closeSelectors();
					}
					else {
						// we close all other opened selectors of this jqCron
						for(var o = _selectors.length; o--; ){
							if(_selectors[o] != selector) {
								_selectors[o].close();
							}
						}
					}
				}
			});
			selector.$.bind('selector:change', function(){
				var boundChanged = false;
				// don't propagate if not initialized
				if(!_initialized) return;
				// bind data between two minute selectors (only if they have the same multiple settings)
				if(settings.multiple_mins == settings.multiple_time_minutes) {
					if(selector == _selectorMins) {
						boundChanged = _selectorTimeM.setValue(_selectorMins.getValue());
					}
					else if(selector == _selectorTimeM) {
						boundChanged = _selectorMins.setValue(_selectorTimeM.getValue());
					}
				}
				// we propagate the change event to the main object
				boundChanged || _$obj.trigger('cron:change', _self.getCron());
			});
			_selectors.push(selector);
			return selector;
		}
215328
def setBlockValue(self, block, value):
        
        if self._bit_count == 0:
            raise Exception( "The margin '" + self._name +
                             "' did not allocate any bits for the values")
        if value < 0:
            raise Exception( "The margin '" + self._name +
                             "' must be a positive integer"  )

        if value >= 2 ** self._bit_count:
            raise Exception( "The margin '" + self._name +
                             "' value exceeds the allocated bit range" )

        newMarginValue = value << self._bitRange[ 0 ]
        currentUserState = block.userState()

        if currentUserState in [ 0, -1 ]:
            block.setUserState(newMarginValue)
        else:
            marginMask = 2 ** self._bit_count - 1
            otherMarginsValue = currentUserState & ~marginMask
            block.setUserState(newMarginValue | otherMarginsValue)
223065
def set_value(self, value, block_events=False):
        
        if block_events: self.block_events()
        self._widget.setValue(value)
        if block_events: self.unblock_events()
566244
def setCollapsed( self, state ):
        
        self.setCollapsible(True)
        if not self._inverted:
            self.setChecked(not state)
        else:
            self.setChecked(state)
167830
def setIsolationMode( self, state ):
        
        self._isolationMode = state
        self.updateIsolated(force = True)
        self.update()
1076081
def _on_action_toggle(self):
        """"""
        block = FoldScope.find_parent_scope(self.editor.textCursor().block())
        self.toggle_fold_trigger(block)
1171029
def _sanity_check_coerce_type_outside_of_fold(ir_blocks):
    """"""
    is_in_fold = False
    for first_block, second_block in pairwise(ir_blocks):
        if isinstance(first_block, Fold):
            is_in_fold = True

        if not is_in_fold and isinstance(first_block, CoerceType):
            if not isinstance(second_block, (MarkLocation, Filter)):
                raise AssertionError(u'Expected MarkLocation or Filter after CoerceType, '
                                     u'but none was found: {}'.format(ir_blocks))

        if isinstance(second_block, Unfold):
            is_in_fold = False
77248
def put_standard_block(self, y, x, val):
        
        for j in range(0,self.cell_height):
            for i in range(0,self.cell_width):
                self.img.put(val, (x*self.cell_width+i, y*self.cell_height+j))
851955
public void visitBlockStatement(BlockStatement block) {
        pushState();
        block.setVariableScope(currentScope);
        super.visitBlockStatement(block);
        popState();
    }
1028710
def toggle_fold_trigger(self, block):
        
        if not TextBlockHelper.is_fold_trigger(block):
            return
        region = FoldScope(block)
        if region.collapsed:
            region.unfold()
            if self._mouse_over_line is not None:
                self._add_scope_decorations(
                    region._trigger, *region.get_range())
        else:
            region.fold()
            self._clear_scope_decos()
        self._refresh_editor_and_scrollbars()
        self.trigger_state_changed.emit(region._trigger, region.collapsed)
120151
def trigger(self, source, actions, event_args):
		
		type = BlockType.TRIGGER
		return self.action_block(source, actions, type, event_args=event_args)
1268351
function expandToWord(sel) {
	sel = sel || getSelection();
	if (sel.modify) {
		collapseStart(sel);
		sel.modify('move', 'backward', 'word');
		sel.modify('extend', 'forward', 'word');
	} else if (sel.type !== 'Control') {
		var range = sel.createRange();
		range.collapse(true);
		range.expand('word');
	}
}
1182889
def push(*values, &block)
      raise_future_proof_exception if finished?
      value = if block_given?
        begin
          block.call(*values)
        rescue => e
          e
        end
      else
        values.size == 1 ? values[0] : values
      end
      super(value)
    end