Write contents to a local file.

def write_file(path, contents):
	"""Write contents to a local file."""
	os.makedirs(os.path.dirname(path), exist_ok=True)
	with open(path, "w") as file:
		file.write(contents)