<s> import math <EOL> def distance ( pa , pb ) : <EOL> ax , ay = pa <EOL> bx , by = pb <EOL> return math . sqrt ( ( ax - bx ) ** <NUM_LIT:2> + ( ay - by ) ** <NUM_LIT:2> ) <EOL> def index_of_nearest ( p , hot_points , distance_f = distance ) : <EOL> """<STR_LIT>""" <EOL> min_dist = None <EOL> nearest_hp_i = None <EOL> for i , hp in enumerate ( hot_points ) : <EOL> dist = distance_f ( p , hp ) <EOL> if min_dist is None or dist < min_dist : <EOL> min_dist = dist <EOL> nearest_hp_i = i <EOL> return nearest_hp_i </s>
