def calculate_size(name, replica_timestamps, target_replica):
data_size = <NUM_LIT:0><EOL>data_size += calculate_size_str(name)<EOL>data_size += INT_SIZE_IN_BYTES<EOL>for replica_timestamps_item in replica_timestamps:<EOL><INDENT>key = replica_timestamps_item[<NUM_LIT:0>]<EOL>val = replica_timestamps_item[<NUM_LIT:1>]<EOL>data_size += calculate_size_str(key)<EOL>data_size += LONG_SIZE_IN_BYTES<EOL><DEDENT>data_size += calculate_size_address(target_replica)<EOL>return data_size<EOL>
Calculates the request payload size