Declare what block will be used in this engine.

        It should be call before adding or setting any component.
        Blocks order will be preserved for runnning task.
506977
def requires(self, *names):
        
        if len(names) == 0:
            raise ValueError("You should give at least one block name")
    
        if self._blocks is not None and len(self._blocks) > 0:
            raise ReliureError("Method 'requires' should be called only once before adding any composant")
        for name in names:
            if name in self._blocks:
                raise ValueError("Duplicate block name %s" % name)
            self._blocks[name] = Block(name)
        self._logger.info(" ** requires ** %s", names)
1213160
public void addBlock(Block block)
    {
        try {
            this.stack.getFirst().add(block);
        } catch (NoSuchElementException e) {
            throw new IllegalStateException("All container blocks are closed, too many calls to endBlockList().");
        }
    }
493585
function Block(options) {
  if (!(this instanceof Block))
    return new Block(options);

  AbstractBlock.call(this);

  this.txs = [];

  this._raw = null;
  this._size = -1;
  this._witness = -1;

  if (options)
    this.fromOptions(options);
}
1271317
synchronized void deleteBlock(Block block) {
    if (!isInitialized()) {
      return;
    }
    BlockScanInfo info = blockMap.get(block);
    if ( info != null ) {
      delBlockInfo(info);
    }
  }
671515
def use(middleware, *args, &block)
      if middleware.kind_of?(Builder)
        # Merge in the other builder's stack into our own
        self.stack.concat(middleware.stack)
      else
        self.stack << [middleware, args, block]
      end

      self
    end
1147119
public void resolveBlock (SceneBlock block, boolean hipri)
    {
        log.debug("Queueing block for resolution", "block", block, "hipri", hipri);
        if (hipri) {
            _queue.prepend(block);
        } else {
            _queue.append(block);
        }
    }
738439
def add_block(pBlock)
      return nil unless pBlock.is_a?(Languages::BlockData)
      pBlock.level = @currentLevel
      @basicStructure.push(pBlock)
    end
14424
def use(middleware, *args, &block)
      if middleware.is_a?(Builder)
        # Merge in the other builder's stack into our own
        stack.concat(middleware.stack)
      else
        stack << [middleware, args, block]
      end

      self
    end
1025450
private int registerBlock(String blockName) {
        int blockNo = blockTabCnt++;
        if (blockTabCnt > blockTab.length) {
            blockTab = (BlockTabRec[]) resizeArray(blockTab, 2 * blockTabCnt);
        }
        BlockTabRec btr = new BlockTabRec();
        blockTab[blockNo] = btr;
        btr.blockName = blockName;
        if (blockName != null) {
            btr.nextWithSameName = lookupBlockName(blockName);
        } else {
            btr.nextWithSameName = -1;
        }
        btr.nestingLevel = currentNestingLevel;
        if (currentNestingLevel > 0) {
            btr.parentBlockNo = openBlocksTab[currentNestingLevel - 1];
        } else {
            btr.parentBlockNo = -1;
        }
        btr.definitionIsOpen = true;
        btr.blockVarCnt = 0;
        btr.firstVarRefNo = -1;
        btr.blockVarNoToVarNoMap = new int[32];
        btr.dummy = false;
        if (blockName != null) {
            blockNameToNoMap.put(blockName.toUpperCase(), new Integer(blockNo));
        }
        return blockNo;
    }
57324
private void addToInvalidates(Block b, boolean ackRequired) {
    StringBuilder sb = new StringBuilder();
    for (Iterator<DatanodeDescriptor> it =
      blocksMap.nodeIterator(b); it.hasNext();) {
      DatanodeDescriptor node = it.next();
      addToInvalidatesNoLog(b, node, ackRequired);
      sb.append(node.getName());
      sb.append(' ');
    }
    if (isInitialized && !isInSafeMode()) {
      // do not log in startup phase
      NameNode.stateChangeLog.info("BLOCK* NameSystem.addToInvalidates: "
              + b.getBlockName() + " is added to invalidSet of " + sb);
    }
  }
624122
private void addSuperBlockStart(int pc) {
        if (GenerateStackMap) {
            if (itsSuperBlockStarts == null) {
                itsSuperBlockStarts = new int[SuperBlockStartsSize];
            } else if (itsSuperBlockStarts.length == itsSuperBlockStartsTop) {
                int[] tmp = new int[itsSuperBlockStartsTop * 2];
                System.arraycopy(itsSuperBlockStarts, 0, tmp, 0,
                    itsSuperBlockStartsTop);
                itsSuperBlockStarts = tmp;
            }
            itsSuperBlockStarts[itsSuperBlockStartsTop++] = pc;
        }
    }
619101
protected Block visitBlock(Block block) {
        if (block == null) {
            return null;
        }

        Statement stmt = (Statement)block.accept(this);

        if (stmt instanceof Block) {
            return (Block)stmt;
        }
        else if (stmt != null) {
            return new Block(stmt);
        }
        else {
            return new Block(block.getSourceInfo());
        }
    }
1274864
@Override // FSDatasetInterface
  public void finalizeBlock(int namespaceId, Block b) throws IOException {
    finalizeBlockInternal(namespaceId, b, true);
  }
753398
public void insertBlock(AbstractBaseDTNode<I, D> blockRoot) {
        blockRoot.removeFromBlockList();

        blockRoot.setNextElement(next);
        if (getNextElement() != null) {
            next.setPrevElement(blockRoot);
        }
        blockRoot.setPrevElement(this);
        next = blockRoot;
    }
769259
private void block() {
        final long steps = this.limits.simpSteps;
        assert this.level == 0;
        assert !this.config.plain;
        if (!this.config.block) { return; }
        if (this.config.blkwait >= this.stats.simplifications) { return; }
        assert this.simplifier == Simplifier.TOPSIMP;
        this.simplifier = Simplifier.BLOCK;
        updateCands();
        final long limit;
        if (this.stats.simplifications <= this.config.blkrtc) { limit = Long.MAX_VALUE; } else { limit = this.stats.steps + 10 * steps / sizePenalty(); }
        while (this.empty == null && !this.candsBlock.empty() && this.stats.steps++ < limit) {
            final int cand = this.candsBlock.top();
            final long priority = this.candsBlock.priority(cand);
            this.candsBlock.pop(cand);
            if (priority == 0 || !var(cand).free()) { continue; }
            blockLit(cand);
            blockLit(-cand);
        }
        assert this.schedule;
        this.schedule = false;
        assert this.simplifier == Simplifier.BLOCK;
        this.simplifier = Simplifier.TOPSIMP;
    }
70570
void insertIntoList(BlockInfo head, int headIndex, BlockInfo tail, int tailIndex, int count) {
    if (head == null)
      return;
    
    // connect tail to now-head
    tail.setNext(tailIndex, blockList);
    if (blockList != null)
      blockList.setPrevious(blockList.findDatanode(this), tail);
    
    // create new head
    blockList = head;
    blockList.setPrevious(headIndex, null);
    
    // add new blocks to the count
    numOfBlocks += count;
  }
461676
def AddBlock(self, block):
        
        if isinstance(block, Block):
            self.blocks.append(block)
            self.max_order = max(self.max_order, block.max_input_order-1)
            self.max_order = max(self.max_order, block.max_output_order)
            for variable in block.inputs+block.outputs:
                self._AddVariable(variable)
        else:
            print(block)
            raise TypeError
        self._utd_graph = False