#NEWLINE# def calculate_heartbeats( shb , chb ) : #NEWLINE# #INDENT# '\n    Given a heartbeat string from the server, and a heartbeat tuple from the client,\n    calculate what the actual heartbeat settings should be.\n\n    :param shb: server heartbeat numbers\n    :param chb: client heartbeat numbers\n    ' #NEWLINE# ( sx , sy ) = shb #NEWLINE# ( cx , cy ) = chb #NEWLINE# x = 0 #NEWLINE# y = 0 #NEWLINE# if ( ( cx != 0 ) and ( sy != '0' ) ) : #NEWLINE# #INDENT# x = max ( cx , int ( sy ) ) #NEWLINE# #UNINDENT# if ( ( cy != 0 ) and ( sx != '0' ) ) : #NEWLINE# #INDENT# y = max ( cy , int ( sx ) ) #NEWLINE# #UNINDENT# return ( x , y )