#NEWLINE# def pop_and_replace_link( links , link_type , replace_by ) : #NEWLINE# #INDENT# for ( ind , link ) in enumerate ( links ) : #NEWLINE# #INDENT# if link . startswith ( link_type ) : #NEWLINE# #INDENT# del links [ ind ] #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# links . append ( replace_by )