old_contents: def nicklower(nick):
  	return nick.lower().replace("[", "{").replace("]", "}") \
  		.replace("|", "\\").replace("^", "~")
  
  def nickeq(nick1, nick2):
  	return nicklower(nick1) == nicklower(nick2)
  
new_contents: import string
  
  def nicklower(nick):
  	return string.translate(nick.lower(), string.maketrans("[]\\~", "{}|^")
  
  def nickeq(nick1, nick2):
  	return nicklower(nick1) == nicklower(nick2)
  
subject: use string.translate for nick lowercase