def calc_avggas_per(period: int):
    for blockno in range(block_start, block_end):
        sum = (- gasused[blockno])
        bk = blockno
        while (timestamp[bk] > (timestamp[blockno] - period)):
            bk -= 1
            sum += gasused[(bk + 1)]
        sum /= period
        avggas_per[period][blockno] = sum
def calc_avggas_per(period: int):
    for blockno in range(block_start, block_end):
        sum = (- gasused[blockno])
        bk = blockno
        while (timestamp[bk] > (timestamp[blockno] - period)):
            bk -= 1
            sum += gasused[(bk + 1)]
        sum /= period
        avggas_per[period][blockno] = sum