Redundant Assignment in Block Class: In the Block class, self.shares is assigned twice in a row, which is likely an error. The first assignment should be removed.
self.shares = shares
self.shares = []
Syntax Error in While Loop: There's a syntax error in the while loop. The condition should be on the same line as the while keyword, or there should be a continuation character (\) at the end of the line.
while len(sharing_blocks) == 0 or \
sharing_blocks[-1].time-sharing_blocks[0].time >= n_blocks_lookback*AVG_INTERVAL:
Syntax Error in If Statement: Similar to the while loop, the if statement has a line continuation issue.
if sharing_blocks[-1].time-sharing_blocks[0].time >= \
n_blocks_lookback*AVG_INTERVAL:
Block
class,self.shares
is assigned twice in a row, which is likely an error. The first assignment should be removed.while
keyword, or there should be a continuation character (\
) at the end of the line.