Get the blocks around the one given.

        Returns: a list of all of those blocks.
240
def get_surrounding_blocks(self):
        

        next = self.next_blocks()
        prev = self.previous_blocks()

        surrounding_blocks = list(chain(prev, [self], next))
        return surrounding_blocks
772752
def block_structure(self):
        
        n, m = self.shape
        if n != m:
            raise AttributeError("block_structure only defined for square "
                                 "matrices")
        for k in range(1, n):
            if ((self.matrix[:k, k:] == 0).all() and
                    (self.matrix[k:, :k] == 0).all()):
                return (k,) + self[k:, k:].block_structure
        return n,
1354748
def have_all_block_data(self):
        
        if not (self.num_blocks_received == self.num_blocks_requested):
            log.debug("num blocks received = %s, num requested = %s" % (self.num_blocks_received, self.num_blocks_requested))
            return False

        return True
254475
def get_block(self, x,y,z, coord=False):
        """
        Laid out like:
        (0,0,0), (0,1,0), (0,2,0) ... (0,127,0), (0,0,1), (0,1,1), (0,2,1) ... (0,127,1), (0,0,2) ... (0,127,15), (1,0,0), (1,1,0) ... (15,127,15)
        
        ::
        
          blocks = []
          for x in range(15):
            for z in range(15):
              for y in range(127):
                blocks.append(Block(x,y,z))
        """

        offset = y + z*128 + x*128*16 if (coord == False) else coord[1] + coord[2]*128 + coord[0]*128*16
        return self.blocksList[offset]
717340
def get_block_info(self):
        
        if not self.finished:
            raise Exception("Not finished downloading")

        ret = []
        for (block_hash, block_data) in self.block_info.items():
            ret.append( (block_data['height'], block_data['txns']) )

        return ret
1220534
def collect_blocks(self):
        
        if self.mode == 'spark':
            return self.values.tordd().sortByKey().values().collect()

        if self.mode == 'local':
            return self.values.values.flatten().tolist()
918659
def get_blocks_this_year(self):
        """"""

        date_start, date_end = get_date_range_this_year()

        return EighthBlock.objects.filter(date__gte=date_start, date__lte=date_end)
902591
def listBlockParents(self, **kwargs):
        
        validParameters = ['block_name']

        requiredParameters = {'forced': validParameters}
        checkInputParameter(method="listBlockParents", parameters=kwargs.keys(), validParameters=validParameters,
                            requiredParameters=requiredParameters)
        if isinstance(kwargs["block_name"], list):
            return self.__callServer("blockparents", data=kwargs, callmethod='POST')
        else:
            return self.__callServer("blockparents", params=kwargs)
174133
def read_blocks(self, block_size=4096):
        
        while True:
            out = self.mf.read(block_size)
            if not out:
                break
            yield bytes(out)
863216
def get_block(self, block_identifier: BlockSpecification) -> Dict:
        """"""
        return self.web3.eth.getBlock(block_identifier)
1067484
def get_src_blocks(self, seed=None):
        

        if seed:
            self.state = seed

        blockseed = self.state
        d = self._sample_d()
        have = 0
        nums = set()
        while have < d:
            num = self._get_next() % self.K
            if num not in nums:
                nums.add(num)
                have += 1
        return blockseed, d, nums
628905
def keys(self):
        """"""
        names = []
        for i in range(self.n_blocks):
            names.append(self.get_block_name(i))
        return names
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))
90113
def differing_blocks(self):
        
        differing_blocks = []
        for (func_a, func_b) in self.function_matches:
            differing_blocks.extend(self.get_function_diff(func_a, func_b).differing_blocks)
        return differing_blocks
97901
def _iter_blocks(self):
        """"""
        lines = []
        for line in self._iter_unfolded_lines():
            if line:
                lines.append(line)
            elif lines:
                self.records_read += 1
                yield lines
                lines = []
        if lines:
            self.records_read += 1
            yield lines
919852
def fetchall(self):
        
        result = r = self.fetchmany(size=self.FETCHALL_BLOCKSIZE)
        while len(r) == self.FETCHALL_BLOCKSIZE or not self._received_last_resultset_part:
            r = self.fetchmany(size=self.FETCHALL_BLOCKSIZE)
            result.extend(r)
        return result
571057
public function getAllBlocks()
    {
        $this->load();

        $blocks = [];
        foreach ($this->blockCache as $blockCache) {
            $blocks = array_merge($blocks, $blockCache);
        }

        return $blocks;
    }