Locks the node in both the x and y directions.
        
        :param      state   <bool>
490543
def setLocked( self, state = True ):
        
        self._xLocked = state
        self._yLocked = state
900649
def lock(self):
        
        if self.locked: return
        from pyny3d.utils import bool2index
        # seed
        self.seed = self.get_seed()
        
        # map
        self.map = self.get_map()

        # map2polygons schedule
        m2p = [[], [], 0] # [polygons, holes, sop]
        index, points = self.get_map()
                
        ## points
        bool_1 = index[:, 1] == -1
        m2p[2] = bool2index(bool_1)
        index_1 = bool2index(np.logical_not(bool_1)) # remain
        index = index[index_1]
        
        ## new index
        index_bool = np.diff(index[:, 2]*1e12
                            +index[:, 1]*1e8 
                            +index[:, 0]*1e4) != 0
        
        ## Dissemination loop
        dif = np.arange(index_bool.shape[0], dtype=int)[index_bool]+1
        dif = np.append(dif, index_bool.shape[0]+1)
        i = 0
        for j in dif:
            if index[i, 2] < 0: # hole
                m2p[1].append(index_1[np.arange(i, j)])
            if index[i, 2] >= 0: # polygon
                m2p[0].append(index_1[np.arange(i, j)])
            i = j
        self.explode_map_schedule = m2p

        # Sort areas
        areas = []
        for poly in self.explode()[0]:
            areas.append(Polygon(poly, False).get_area())
        self.sorted_areas = np.argsort(np.array(areas))[::-1]
        
        # Lock
        self.locked = True
879551
public IBlockState invert(IBlockState state)
	{
		boolean value = !get(state);
		return set(state, value);
	}
420694
def reset_state(self):
        """"""
        self.y = self.y0.copy()
        self.dy = np.zeros(self.dmps)   
        self.ddy = np.zeros(self.dmps)  
        self.cs.reset_state()
940364
def setLocked(self, state, force=False):
        
        if not force and state == self._locked:
            return
        
        self._locked = state
        tabbar = self.tabBar()
        tabbar.setLocked(state)
        if self.hideTabsWhenLocked():
            tabbar.setVisible(self.count() > 1 or not state)
        else:
            tabbar.setVisible(True)

        if tabbar.isVisible():
            self.setContentsMargins(6, tabbar.height(), 6, 6)
        else:
            self.setContentsMargins(1, 1, 1, 1)

        self.adjustSizeConstraint()
229358
def set_state(self, onoff, channel=None):
        """"""
        try:
            onoff = bool(onoff)
        except Exception as err:
            LOG.debug("HelperActorState.set_state: Exception %s" % (err,))
            return False

        self.writeNodeData("STATE", onoff, channel)
1214719
def annotate_states(node: ast.Node) -> None:
    
    w = TreeWalker()
    w.walk(StateAnnotator(node), node)
1075704
@Override
    public void setState(MotorState state) {

        switch(state) {
            case STOP: {
                // set internal tracking state
                currentState = MotorState.STOP;

                // turn all GPIO pins to OFF state
                for(GpioPinDigitalOutput pin : pins)
                    pin.setState(offState);

                break;
            }
            case FORWARD: {
                // set internal tracking state
                currentState = MotorState.FORWARD;

                // start control thread if not already running
                if(!controlThread.isAlive()) {
                    controlThread = new GpioStepperMotorControl();
                    controlThread.start();
                }

                break;
            }
            case REVERSE: {
                // set internal tracking state
                currentState = MotorState.REVERSE;

                // start control thread if not already running
                if(!controlThread.isAlive()) {
                    controlThread = new GpioStepperMotorControl();
                    controlThread.start();
                }

                break;
            }
            default: {
                throw new UnsupportedOperationException("Cannot set motor state: " + state.toString());
            }
        }
    }
234123
public void setEditingState(String state) {
		if ("idle".equalsIgnoreCase(state)) {
			delegate.setEditingState(GeometryEditState.IDLE);
		} else if ("dragging".equalsIgnoreCase(state)) {
			delegate.setEditingState(GeometryEditState.DRAGGING);
		} else if ("inserting".equalsIgnoreCase(state)) {
			delegate.setEditingState(GeometryEditState.INSERTING);
		}
	}
1283673
def setSnapToGrid( self, state = True ):
        
        self._xSnapToGrid = state
        self._ySnapToGrid = state
583630
public void lockEdgeInternal(String childName, LockMode mode) {
    Preconditions.checkState(endsInInode());

    Inode lastInode = get(numLockedInodes() - 1);
    Edge edge = new Edge(lastInode.getId(), childName);
    mEntries.add(new EdgeEntry(mInodeLockManager.lockEdge(edge, mode), edge));
  }
1168577
def block_sep1(self, Y):
        
        """

        return Y[(slice(None),)*self.blkaxis + (slice(self.blkidx, None),)]
1156633
@Override
	public final void lock(int handle) throws DataStoreException 
    {
        if (SAFE_MODE) checkHandle(handle);
        if (!locks.flip(handle))
        {
            locks.flip(handle); // Restore state
            throw new DataStoreException("Handle already locked : "+handle);
        }
    }
655649
function initializeStates()
    {
        // Set all states to NOT_READY
        var numVertices = graph.vertexCount();
        var vertexIds = graph.getVertexIds();

        for(var i = 0; i < numVertices; i++)
        {
            graph.getVertex(vertexIds[i]).setState("NOT_READY");
        }
    }
956066
public void replaceBlocks(World world, MBlockState state)
	{
		AxisAlignedBB[] aabbs = AABBUtils.getCollisionBoundingBoxes(world, state, true);
		for (AxisAlignedBB aabb : aabbs)
		{
			if (aabb == null)
				continue;

			for (BlockPos pos : BlockPosUtils.getAllInBox(aabb))
			{
				if (world.getBlockState(pos).getBlock().isReplaceable(world, pos))
					world.setBlockToAir(pos);
			}
		}
	}
441437
function toggle(pos, state, ruleId) {
      var markers = ruleId ? scope[ruleId] : globals
      var currentState
      var previousState

      if (!markers) {
        markers = []
        scope[ruleId] = markers
      }

      previousState = getState(ruleId)
      currentState = state

      if (currentState !== previousState) {
        markers.push({state: currentState, position: pos})
      }

      /* Toggle all known rules. */
      if (!ruleId) {
        for (ruleId in scope) {
          toggle(pos, state, ruleId)
        }
      }
    }
1171960
function(state, nodeA, sepHandlerA, nodeB, sepHandlerB) {
	let sepType, nlConstraints, aCons, bCons;

	if (nodeA.nextSibling === nodeB) {
		// sibling separator
		sepType = "sibling";
		aCons = sepHandlerA.after(nodeA, nodeB, state);
		bCons = sepHandlerB.before(nodeB, nodeA, state);
		nlConstraints = getSepNlConstraints(state, nodeA, aCons, nodeB, bCons);
	} else if (nodeB.parentNode === nodeA) {
		// parent-child separator, nodeA parent of nodeB
		sepType = "parent-child";
		aCons = sepHandlerA.firstChild(nodeA, nodeB, state);
		bCons = sepHandlerB.before(nodeB, nodeA, state);
		nlConstraints = getSepNlConstraints(state, nodeA, aCons, nodeB, bCons);
	} else if (nodeA.parentNode === nodeB) {
		// parent-child separator, nodeB parent of nodeA
		sepType = "child-parent";
		aCons = sepHandlerA.after(nodeA, nodeB, state);
		bCons = sepHandlerB.lastChild(nodeB, nodeA, state);
		nlConstraints = getSepNlConstraints(state, nodeA, aCons, nodeB, bCons);
	} else {
		// sibling separator
		sepType = "sibling";
		aCons = sepHandlerA.after(nodeA, nodeB, state);
		bCons = sepHandlerB.before(nodeB, nodeA, state);
		nlConstraints = getSepNlConstraints(state, nodeA, aCons, nodeB, bCons);
	}

	if (nodeA.nodeName === undefined) {
		console.trace();
	}

	if (state.sep.constraints) {
		// Merge the constraints
		state.sep.constraints = mergeConstraints(
			state.env,
			state.sep.constraints,
			nlConstraints
		);
	} else {
		state.sep.constraints = nlConstraints;
	}

	state.env.log('debug/wts/sep', function() {
		return 'constraint' +
			' | ' + sepType +
			' | <' + nodeA.nodeName + ',' + nodeB.nodeName + '>' +
			' | ' + JSON.stringify(state.sep.constraints) +
			' | ' + debugOut(nodeA) +
			' | ' + debugOut(nodeB);
	});

	state.sep.constraints.constraintInfo = {
		onSOL: state.onSOL,
		// force SOL state when separator is built/emitted
		forceSOL: sepHandlerB.forceSOL,
		sepType: sepType,
		nodeA: nodeA,
		nodeB: nodeB,
	};
}