<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parityOf(int_type):
 """ Calculates the parity of an integer, returning 0 if there are an even number of set bits, and -1 if there are an odd number. """

    parity = 0
    while (int_type):
        parity = ~parity
        int_type = int_type & (int_type - 1)
    return(parity)