def calculate_size(name, entries):
data_size = <NUM_LIT:0><EOL>data_size += calculate_size_str(name)<EOL>data_size += INT_SIZE_IN_BYTES<EOL>for key, val in six.iteritems(entries):<EOL><INDENT>data_size += calculate_size_data(key)<EOL>data_size += calculate_size_data(val)<EOL><DEDENT>return data_size<EOL>
Calculates the request payload size