def spDiff(SP1,SP2):
if(len(SP1._masterConnectedM)!=len(SP2._masterConnectedM)):<EOL><INDENT>print("<STR_LIT>")<EOL>return False<EOL><DEDENT>if(len(SP1._masterPotentialM)!=len(SP2._masterPotentialM)):<EOL><INDENT>print("<STR_LIT>")<EOL>return False<EOL><DEDENT>if(len(SP1._masterPermanenceM)!=len(SP2._masterPermanenceM)):<EOL><INDENT>print("<STR_LIT>")<EOL>return False<EOL><DEDENT>for i in range(<NUM_LIT:0>,len(SP1._masterConnectedM)):<EOL><INDENT>connected1 = SP1._masterConnectedM[i]<EOL>connected2 = SP2._masterConnectedM[i]<EOL>if(connected1!=connected2):<EOL><INDENT>print("<STR_LIT>"  % (i))<EOL>return False<EOL><DEDENT>permanences1 = SP1._masterPermanenceM[i];<EOL>permanences2 = SP2._masterPermanenceM[i];<EOL>if(permanences1!=permanences2):<EOL><INDENT>print("<STR_LIT>" % (i))<EOL>return False<EOL><DEDENT>potential1 = SP1._masterPotentialM[i];<EOL>potential2 = SP2._masterPotentialM[i];<EOL>if(potential1!=potential2):<EOL><INDENT>print("<STR_LIT>" % (i))<EOL>return False<EOL><DEDENT><DEDENT>if(not numpy.array_equal(SP1._firingBoostFactors,SP2._firingBoostFactors)):<EOL><INDENT>print("<STR_LIT>")<EOL>return False<EOL><DEDENT>if(not numpy.array_equal(SP1._dutyCycleAfterInh,SP2._dutyCycleAfterInh)):<EOL><INDENT>print("<STR_LIT>")<EOL>return False<EOL><DEDENT>if(not numpy.array_equal(SP1._dutyCycleBeforeInh,SP2._dutyCycleBeforeInh)):<EOL><INDENT>print("<STR_LIT>")<EOL>return False<EOL><DEDENT>print("<STR_LIT>")<EOL>return True<EOL>
Function that compares two spatial pooler instances. Compares the
static variables between the two poolers to make sure that they are equivalent.

Parameters
-----------------------------------------
SP1 first spatial pooler to be compared

SP2 second spatial pooler to be compared

To establish equality, this function does the following:

1.Compares the connected synapse matrices for each coincidence

2.Compare the potential synapse matrices for each coincidence

3.Compare the permanence matrices for each coincidence

4.Compare the firing boosts between the two poolers.

5.Compare the duty cycles before and after inhibition for both poolers