#NEWLINE# def distance( s , inds ) : #NEWLINE# #INDENT# '\n    Distance between pairs of stamps, normalized by\n    stamp size\n\n    ' #NEWLINE# x = s [ : , 1 ] #NEWLINE# y = s [ : , 2 ] #NEWLINE# r = s [ : , 3 ] #NEWLINE# result = np . hypot ( ( x - x [ inds ] ) , ( y - y [ inds ] ) ) #NEWLINE# result /= np . sqrt ( ( inds * r [ inds ] ) ) #NEWLINE# result [ ( inds == ( - 1 ) ) ] = np . inf #NEWLINE# return result