#NEWLINE# def ameliore( S , d ) : #NEWLINE# #INDENT# G = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for p in S : #NEWLINE# #INDENT# ( a , b ) = cell ( p , ( d / 2 ) ) #NEWLINE# for a1 in range ( ( a - 2 ) , ( a + 3 ) ) : #NEWLINE# #INDENT# for b1 in range ( ( b - 2 ) , ( b + 3 ) ) : #NEWLINE# #INDENT# if ( ( a1 , b1 ) in G ) : #NEWLINE# #INDENT# q = G [ ( a1 , b1 ) ] #NEWLINE# pq = dist ( p , q ) #NEWLINE# if ( pq < d ) : #NEWLINE# #INDENT# return ( pq , p , q ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# G [ ( a , b ) ] = p #NEWLINE# #UNINDENT# return None