Amended code of conduct says judges may attend political, diplomatic functions only with chief justice’s approval