Look up notifications for a block
        Args:
            block_number (int): height of block to search for notifications

        Returns:
            list: a list of notifications
541055
def get_by_block(self, block_number):
        
        blocklist_snapshot = self.db.prefixed_db(NotificationPrefix.PREFIX_BLOCK).snapshot()
        block_bytes = block_number.to_bytes(4, 'little')
        results = []
        for val in blocklist_snapshot.iterator(prefix=block_bytes, include_key=False):
            event = SmartContractEvent.FromByteArray(val)
            results.append(event)

        return results
1318587
def get_all(self, request, notifications, mark_as_read=False):
        
        return self.list(request, notifications)
1280545
def notifications(self):
        
        if self._notifications is None:
            self._notifications = NotificationList(self._version, service_sid=self._solution['sid'], )
        return self._notifications
1187181
def _build_block_element_list(self):
        
        return sorted(
            [e for e in self.block_elements.values() if not e.virtual],
            key=lambda e: e.priority,
            reverse=True
        )
1269551
def get_canonical_block_header_by_number(self, block_number: BlockNumber) -> BlockHeader:
        
        return self._get_canonical_block_header_by_number(self.db, block_number)
445114
def eth_getBlockByNumber(self, number):
        
        block_hash = self.reader._get_block_hash(number)
        block_number = _format_block_number(number)
        body_key = body_prefix + block_number + block_hash
        block_data = self.db.get(body_key)
        body = rlp.decode(block_data, sedes=Block)
        return body
1301975
def listBlockChildren(self, block_name=""):
        
        if (not block_name) or re.search("['%','*']", block_name):
            dbsExceptionHandler("dbsException-invalid-input", "DBSBlock/listBlockChildren. Block_name must be provided." )
        conn = self.dbi.connection()
        try:
            results = self.blockchildlist.execute(conn, block_name)
            return results
        finally:
            if conn:
                conn.close()
689308
def get_block_height(height, api_code=None):
    

    resource = 'block-height/{0}?format=json'.format(height)
    if api_code is not None:
        resource += '&api_code=' + api_code
    response = util.call_api(resource)
    json_response = json.loads(response)
    return [Block(b) for b in json_response['blocks']]
105557
def get_block_by_number(self, block_number, full_transactions=True):
        
        if isinstance(block_number, numbers.Number):
            block_number_as_hex = hex(block_number)
        else:
            block_number_as_hex = block_number
        response = self.make_request(
            "eth_getBlockByNumber", [block_number_as_hex, full_transactions],
        )
        return response['result']
750218
def notifications(self):
        
        if self._notifications is None:
            self._notifications = NotificationList(self._version, account_sid=self._solution['sid'], )
        return self._notifications
570767
def get_catchup_block_ids(self, last_known_block_id):
        '''
        
        '''
        # If latest known block is not the current chain head, catch up
        catchup_up_blocks = []
        chain_head = self._block_store.chain_head
        if chain_head and last_known_block_id != chain_head.identifier:
            # Start from the chain head and get blocks until we reach the
            # known block
            for block in self._block_store.get_predecessor_iter():
                # All the blocks if NULL_BLOCK_IDENTIFIER
                if last_known_block_id != NULL_BLOCK_IDENTIFIER:
                    if block.identifier == last_known_block_id:
                        break
                catchup_up_blocks.append(block.identifier)

        return list(reversed(catchup_up_blocks))
841720
def getUncleCount(self, block_identifier):
        
        method = select_method_for_block_identifier(
            block_identifier,
            if_predefined='eth_getUncleCountByBlockNumber',
            if_hash='eth_getUncleCountByBlockHash',
            if_number='eth_getUncleCountByBlockNumber',
        )
        result = self.web3.manager.request_blocking(
            method,
            [block_identifier],
        )
        if result is None:
            raise BlockNotFound(f"Block with id: {block_identifier} not found.")
        return result
1055084
def listBlockChildren(self, block_name=""):
        
        block_name = block_name.replace("*", "%")
        try:
            return self.dbsBlock.listBlockChildren(block_name)
        except dbsException as de:
            dbsExceptionHandler(de.eCode, de.message, self.logger.exception, de.serverError)
        except Exception as ex:
            sError = "DBSReaderModel/listBlockChildren. %s\n. Exception trace: \n %s" % (ex, traceback.format_exc())
            dbsExceptionHandler('dbsException-server-error', dbsExceptionCode['dbsException-server-error'], self.logger.exception, sError)
403050
int numNodes(Block b) {
    BlockInfo info = blocks.get(b);
    return info == null ? 0 : info.numNodes();
  }
343459
def get_upcoming_blocks(self, max_number=-1):
        

        now = datetime.datetime.now()

        # Show same day if it's before 17:00
        if now.hour < 17:
            now = now.replace(hour=0, minute=0, second=0, microsecond=0)

        blocks = self.order_by("date", "block_letter").filter(date__gte=now)

        if max_number == -1:
            return blocks

        return blocks[:max_number]
847324
def list_blocks(self):
        
        logger.debug("listing blocks")
        blocksList = BlocksList()
        result = self.library.Cli_ListBlocks(self.pointer, byref(blocksList))
        check_error(result, context="client")
        logger.debug("blocks: %s" % blocksList)
        return blocksList
676493
def _get_notifications_status(self, notifications):
        
        if notifications:
            size = len(notifications["activeNotifications"])
        else:
            size = 0
        status = self.status_notif if size > 0 else self.status_no_notif

        return (size, status)