code: def block_ranges(start_block, last_block, step=5):
      
  
      if last_block is not None and start_block > last_block:
          raise TypeError(
              "Incompatible start and stop arguments.",
              "Start must be less than or equal to stop.")
  
      return (
          (from_block, to_block - 1)
          for from_block, to_block
          in segment_count(start_block, last_block + 1, step)
      )
docs: Returns 2-tuple ranges describing ranges of block from start_block to last_block
  
         Ranges do not overlap to facilitate use as ``toBlock``, ``fromBlock``
         json-rpc arguments, which are both inclusive.