def calculate_size(name, new_value):
data_size = <NUM_LIT:0><EOL>data_size += calculate_size_str(name)<EOL>data_size += BOOLEAN_SIZE_IN_BYTES<EOL>if new_value is not None:<EOL><INDENT>data_size += calculate_size_data(new_value)<EOL><DEDENT>return data_size<EOL>
Calculates the request payload size