code: def estimate_blocktime(self, oldest: int = 256) -> float:
          
          last_block_number = self.block_number()
          # around genesis block there is nothing to estimate
          if last_block_number < 1:
              return 15
          # if there are less than `oldest` blocks available, start at block 1
          if last_block_number < oldest:
              interval = (last_block_number - 1) or 1
          else:
              interval = last_block_number - oldest
          assert interval > 0
          last_timestamp = self.get_block_header(last_block_number)['timestamp']
          first_timestamp = self.get_block_header(last_block_number - interval)['timestamp']
          delta = last_timestamp - first_timestamp
          return delta / interval
docs: Calculate a blocktime estimate based on some past blocks.
          Args:
              oldest: delta in block numbers to go back.
          Return:
              average block time in seconds