Gets the blocks.

@param startBlockNumber
the start block number
@param endBlockNumber
the end block number
@return the blocks
544946
public void saveBlocks(BigInteger startBlockNumber, BigInteger endBlockNumber)
    {

        if (endBlockNumber.compareTo(startBlockNumber) < 1)
        {
            LOGGER.error("startBlockNumber must be smaller than endBlockNumer");
            throw new KunderaException("startBlockNumber must be smaller than endBlockNumer");
        }

        if (startBlockNumber.compareTo(getFirstBlockNumber()) < 0)
        {
            LOGGER.error("start block number can't be smaller than EARLIEST block");
            throw new KunderaException("starting block number can't be smaller than EARLIEST block");
        }

        if (endBlockNumber.compareTo(getLatestBlockNumber()) > 0)
        {
            LOGGER.error("end block number can't be larger than LATEST block");
            throw new KunderaException("end block number can't be larger than LATEST block");
        }

        long diff = endBlockNumber.subtract(startBlockNumber).longValue();

        for (long i = 0; i <= diff; i++)
        {
            EthBlock block = null;
            BigInteger currentBlockNum = null;
            try
            {
                currentBlockNum = startBlockNumber.add(BigInteger.valueOf(i));
                block = web3j.ethGetBlockByNumber(DefaultBlockParameter.valueOf(currentBlockNum), true).send();
            }
            catch (IOException ex)
            {
                LOGGER.error("Not able to find block" + currentBlockNum + ". ", ex);
                throw new KunderaException("Not able to find block" + currentBlockNum + ". ", ex);
            }
            persistBlocksAndTransactions(block);
        }

    }
1236319
public List<BlockProperty> findPropertiesBlockByName( String propertyName ) {

		List<BlockProperty> result = new ArrayList<> ();
		for( AbstractBlock region : this.innerBlocks ) {
			if( region.getInstructionType() == PROPERTY
					&& propertyName.equals(((BlockProperty) region).getName())) {

				result.add((BlockProperty) region);
			}
		}

		return result;
	}
1150995
public Block getBlockWithTransactions(BigInteger blockNumber)
    {
        return EtherObjectConverterUtil.convertEtherBlockToKunderaBlock(client.getBlock(blockNumber, true));
    }
70130
protected function linkBlocks()
	{
		$ends = array();

		$elements = $this->elements;

		$result = array();
		while ($element = array_pop($elements)) {

			if ($element instanceof Abstraction\SupraMarkupBlockStart) {

				/* @var $end Abstraction\SupraMarkupBlockEnd */
				$end = array_pop($ends);


				// Check if we hava a matching end for this start and check if their signature match,
				// or skip this check if truncation of invalid blocks is disabled.
				if (
						( ! empty($end) && $end->getSignature() == $element->getSignature() ) ||
						$this->truncateInvalidBlocks == false
				) {
					
					$end->setStart($element);
					$element->setEnd($end);

					array_unshift($result, $element);
				}
			}
			else if ($element instanceof Abstraction\SupraMarkupBlockEnd) {

				array_unshift($result, $element);
				$ends[] = $element;
			}
			else {
				array_unshift($result, $element);
			}
		}

		$this->elements = $result;
	}
654208
private void readTableBlock(int startIndex, int blockLength)
   {
      for (int index = startIndex; index < (startIndex + blockLength - 11); index++)
      {
         if (matchPattern(TABLE_BLOCK_PATTERNS, index))
         {
            int offset = index + 7;
            int nameLength = FastTrackUtility.getInt(m_buffer, offset);
            offset += 4;
            String name = new String(m_buffer, offset, nameLength, CharsetHelper.UTF16LE).toUpperCase();
            FastTrackTableType type = REQUIRED_TABLES.get(name);
            if (type != null)
            {
               m_currentTable = new FastTrackTable(type, this);
               m_tables.put(type, m_currentTable);
            }
            else
            {
               m_currentTable = null;
            }
            m_currentFields.clear();
            break;
         }
      }
   }
1184091
public Block[] getBlocksBeingWrittenReport(int namespaceId) throws IOException {
    LightWeightHashSet<Block> blockSet = new LightWeightHashSet<Block>();
    volumes.getBlocksBeingWrittenInfo(namespaceId, blockSet);
    Block blockTable[] = new Block[blockSet.size()];
    int i = 0;
      for (Iterator<Block> it = blockSet.iterator(); it.hasNext(); i++) {
    blockTable[i] = it.next();
    }
    return blockTable;
  }
898000
public java.util.List<EbsBlockDevice> getEbsBlockDevices() {
        if (ebsBlockDevices == null) {
            ebsBlockDevices = new com.amazonaws.internal.SdkInternalList<EbsBlockDevice>();
        }
        return ebsBlockDevices;
    }
1149571
public function endBlock()
    {
        if (!$this->openBlocks) {
            throw new RuntimeException('No block started.');
        }

        $name  = array_pop($this->openBlocks);
        $value = ob_get_clean();

        if ($this->blocks[$name] === null) {
            $this->blocks[$name] = $value;
        }

        return $this->blocks[$name];
    }
238346
function getBlockNodes(nodes) {
  // TODO(perf): update `nodes` instead of creating a new object?
  var node = nodes[0];
  var endNode = nodes[nodes.length - 1];
  var blockNodes;

  for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {
    if (blockNodes || nodes[i] !== node) {
      if (!blockNodes) {
        blockNodes = jqLite(slice.call(nodes, 0, i));
      }
      blockNodes.push(node);
    }
  }

  return blockNodes || nodes;
}
1098084
public synchronized List<Message> getFromRange(final int startPosition, final int endPosition) {
        // cache this here, so all parts of the method operate on the same data
        final int firstMessageId = this.getFirstPosition();
        // input validation
        if ((startPosition < MessageStore.INITIAL_MESSAGE_POSITION)
                || (endPosition < MessageStore.INITIAL_MESSAGE_POSITION)) {
            throw new IllegalArgumentException("Message position cannot be negative.");
        } else if ((firstMessageId >= MessageStore.INITIAL_MESSAGE_POSITION) && (startPosition < firstMessageId)) {
            throw new IllegalArgumentException("Message at position " + startPosition
                    + " had already been discarded. First available message position is " + firstMessageId + ".");
        } else if (endPosition <= startPosition) {
            throw new IllegalArgumentException("Ending position must be larger than starting message position.");
        } else if (endPosition > this.getNextPosition()) {
            throw new IllegalArgumentException("Range end cannot be greater than the next message position.");
        }
        // and properly synchronized range retrieval
        return Collections.unmodifiableList(new LinkedList<>(this.store.subMap(startPosition, endPosition)
                .values()));
    }
470827
public <T> List<T> range(long start,long end){
    	Set<byte[]> result = null;
        try {    		
        	if(isCluster(groupName)){
        		result = getBinaryJedisClusterCommands(groupName).zrange(keyBytes, start, end);
        	}else{
        		result = getBinaryJedisCommands(groupName).zrange(keyBytes, start, end);
        	}
        	return toObjectList(new ArrayList<>(result));
    	} finally{
			getJedisProvider(groupName).release();
		}
	}
68679
public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) {
    if (blocks == null) {
      return new BlockLocation[0];
    }
    int nrBlocks = blocks.locatedBlockCount();
    BlockLocation[] blkLocations = new BlockLocation[nrBlocks];
    if (nrBlocks == 0) {
      return blkLocations;
    }
    int idx = 0;
    for (LocatedBlock blk : blocks.getLocatedBlocks()) {
      assert idx < nrBlocks : "Incorrect index";
      DatanodeInfo[] locations = blk.getLocations();
      String[] hosts = new String[locations.length];
      String[] names = new String[locations.length];
      String[] racks = new String[locations.length];
      for (int hCnt = 0; hCnt < locations.length; hCnt++) {
        hosts[hCnt] = locations[hCnt].getHostName();
        names[hCnt] = locations[hCnt].getName();
        NodeBase node = new NodeBase(names[hCnt],
                                     locations[hCnt].getNetworkLocation());
        racks[hCnt] = node.toString();
      }
      blkLocations[idx] = new BlockLocation(names, hosts, racks,
                                            blk.getStartOffset(),
                                            blk.getBlockSize(),
                                            blk.isCorrupt());
      idx++;
    }
    return blkLocations;
  }
1346893
private int getNumBlocks(R delta) {
        ByteBuffer content = getValue(delta);
        int numBlocks = 0;

        // build numBlocks by adding together each hex digit
        for (int i = 0; i < _prefixLength; i++) {
            byte b = content.get(i);
            numBlocks = numBlocks << 4 | (b <= '9' ? b - '0' : b - 'A' + 10);
        }

        return numBlocks;
    }
736232
async def blocks(client: Client, pubkey: str, start: int, end: int) -> dict:
    
    return await client.get(MODULE + '/history/%s/blocks/%s/%s' % (pubkey, start, end), schema=HISTORY_SCHEMA)
1176875
@Override
  public BlockLocationsResponse getBlockLocations(GetBlockLocationsRequest req) throws IOException {
    Server.setOrignalCaller(req.getOriginalCaller());
    return new BlockLocationsResponse(getBlockLocationsInternal(req.getSrc(), req.getOffset(),
        req.getLength(), BlockMetaInfoType.NONE));
  }
819091
def _find_block(starts, ends, cur_block, rec_num):   # @NoSelf
        '''
        
        '''
        total = len(starts)
        if (cur_block == -1):
            cur_block = 0
        for x in range(cur_block, total):
            if (starts[x] <= rec_num and ends[x] >= rec_num):
                return x, x
            if (starts[x] > rec_num):
                break
        return -1, x-1
196579
@Override
	public int getMinPrefixLengthForBlock() {
		int count = getDivisionCount();
		int totalPrefix = getBitCount();
		for(int i = count - 1; i >= 0 ; i--) {
			AddressDivisionBase div = getDivision(i);
			int segBitCount = div.getBitCount();
			int segPrefix = div.getMinPrefixLengthForBlock();
			if(segPrefix == segBitCount) {
				break;
			} else {
				totalPrefix -= segBitCount;
				if(segPrefix != 0) {
					totalPrefix += segPrefix;
					break;
				}
			}
		}
		return totalPrefix;
	}