Returns the requested block as specified by the block header.
491875
def get_block_by_header(self, block_header: BlockHeader) -> BaseBlock:
        
        vm = self.get_vm(block_header)
        return vm.block
1108912
def getheader(self, name, default=None):
        
        return self.response.headers.get(name, default)
217077
private int getDataBlock(int c, boolean forLSCP) {
        int i2, oldBlock, newBlock;

        i2=getIndex2Block(c, forLSCP);
        
        i2+=(c>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK;
        oldBlock=index2[i2];
        if(isWritableBlock(oldBlock)) {
            return oldBlock;
        }

        /* allocate a new data block */
        newBlock=allocDataBlock(oldBlock);
        setIndex2Entry(i2, newBlock);
        return newBlock;
    }
85851
def get_block_by_hash(self, block_hash, full_transactions=True):
        
        response = self.make_request("eth_getBlockByHash", [block_hash, full_transactions])
        return response['result']
996791
def eth_getBlockHeaderByNumber(self, number):
        
        block_hash = self.reader._get_block_hash(number)
        block_number = _format_block_number(number)
        return self.reader._get_block_header(block_hash, block_number)
640165
def get_block_type(self, def_id):
        """"""
        try:
            return self._definitions[def_id]
        except KeyError:
            try:
                return def_id.aside_type
            except AttributeError:
                raise NoSuchDefinition(repr(def_id))
647765
def get_http_header(self) -> Response:
        '''
        '''
        with wpull.util.reset_file_offset(self.block_file):
            data = self.block_file.read(4096)

        match = re.match(br'(.*?\r?\n\r?\n)', data)

        if not match:
            return

        status_line, dummy, field_str = match.group(1).partition(b'\n')

        try:
            version, code, reason = Response.parse_status_line(status_line)
        except ValueError:
            return

        response = Response(status_code=code, reason=reason, version=version)

        try:
            response.fields.parse(field_str, strict=False)
        except ValueError:
            return

        return response
462961
@Override
  public Block getPenultimateBlock() {
    if (blocks == null || blocks.length <= 1) {
      return null;
    }
    return blocks[blocks.length - 2];
  }
1065983
def getBlock(block, _ignore_alloc = false)
      raise "Ext3::Superblock.getBlock: block is nil" if block.nil?

      unless @block_cache.key?(block)
        if block == 0
          @block_cache[block] = MemoryBuffer.create(@blockSize)
        else
          # raise "Block #{block} is not allocated" if (not gde.blockAllocBmp[offset] and not ignore_alloc)

          address = blockToAddress(block)  # This function will read the block into our cache

          @stream.seek(address)
          @block_cache[block] = @stream.read(@blockSize)
        end
      end
      @block_cache[block]
    end
295451
def get_processing_block(block_id):
    """"""
    identifiers = block_id.split(':')
    scheduling_block_id = identifiers[0]
    scheduling_block_config = get_scheduling_block(scheduling_block_id)
    for processing_block in scheduling_block_config['processing_blocks']:
        if processing_block['id'] == block_id:
            return processing_block
    raise KeyError('Unknown Processing Block id: {} ({})'
                   .format(identifiers[-1], block_id))
832544
def get(self, block=1, delay=None):
        """"""
        if _debug: IOQueue._debug("get block=%r delay=%r", block, delay)

        # if the queue is empty and we do not block return None
        if not block and not self.notempty.isSet():
            if _debug: IOQueue._debug("    - not blocking and empty")
            return None

        # wait for something to be in the queue
        if delay:
            self.notempty.wait(delay)
            if not self.notempty.isSet():
                return None
        else:
            self.notempty.wait()

        # extract the first element
        priority, iocb = self.queue[0]
        del self.queue[0]
        iocb.ioQueue = None

        # if the queue is empty, clear the event
        qlen = len(self.queue)
        if not qlen:
            self.notempty.clear()

        # return the request
        return iocb
865099
function _getBlock (config, type, multi) {
  const options = {
    uri: _buildUrl(config, type, multi)
  }

  if (config.headers) {
    options['headers'] = config.headers
  }
  return request.get(options).then(result => { return { blockName: type, result: result } })
}
889921
def import_block(self,
                     block: BaseBlock,
                     perform_validation: bool=True
                     ) -> Tuple[BaseBlock, Tuple[BaseBlock, ...], Tuple[BaseBlock, ...]]:
        

        try:
            parent_header = self.get_block_header_by_hash(block.header.parent_hash)
        except HeaderNotFound:
            raise ValidationError(
                "Attempt to import block #{}.  Cannot import block {} before importing "
                "its parent block at {}".format(
                    block.number,
                    block.hash,
                    block.header.parent_hash,
                )
            )

        base_header_for_import = self.create_header_from_parent(parent_header)
        imported_block = self.get_vm(base_header_for_import).import_block(block)

        # Validate the imported block.
        if perform_validation:
            validate_imported_block_unchanged(imported_block, block)
            self.validate_block(imported_block)

        (
            new_canonical_hashes,
            old_canonical_hashes,
        ) = self.chaindb.persist_block(imported_block)

        self.logger.debug(
            'IMPORTED_BLOCK: number %s | hash %s',
            imported_block.number,
            encode_hex(imported_block.hash),
        )

        new_canonical_blocks = tuple(
            self.get_block_by_hash(header_hash)
            for header_hash
            in new_canonical_hashes
        )
        old_canonical_blocks = tuple(
            self.get_block_by_hash(header_hash)
            for header_hash
            in old_canonical_hashes
        )

        return imported_block, new_canonical_blocks, old_canonical_blocks
82543
def get():
    """"""

    LOG.debug('GET Processing Block list')
    _url = get_root_url()

    # Get list of Processing block Ids
    block_ids = sorted(DB.get_processing_block_ids())
    LOG.debug('Processing Block IDs: %s', block_ids)

    # Construct response object
    response = dict(num_processing_blocks=len(block_ids),
                    processing_blocks=list())

    # Loop over blocks and add block summary to response.
    for block in DB.get_block_details(block_ids):
        block_id = block['id']
        LOG.debug('Creating PB summary for %s', block_id)
        block['links'] = dict(
            detail='{}/processing-block/{}'.format(_url, block_id),
            scheduling_block='{}/scheduling-block/{}'
            .format(_url, block_id.split(':')[0])
        )
        response['processing_blocks'].append(block)
    response['links'] = {
        'self': '{}'.format(request.url),
        'home': '{}'.format(_url)
    }
    return response, HTTPStatus.OK
238034
def getc(self, block=True):
        """"""
        try:
            return self.cookedq.get(block)
        except gevent.queue.Empty:
            return ''
285634
def getoneblock(astr, start, end):
    """"""
    alist = astr.split(start)
    astr = alist[-1]
    alist = astr.split(end)
    astr = alist[0]
    return astr
412333
def build_block(self):
        
        header_bytes = self.block_header.SerializeToString()
        block = Block(header=header_bytes,
                      header_signature=self._header_signature)
        block.batches.extend(self.batches)
        return block