write_gate
