I can't answer you on the code. I do want to comment on a couple of other things.
The directions aren't near explicit enough about ''The cold water gate valve must be left open while a water heater is in use.'' Water must always be free to flow back out of a heated tank. Many places are now requiring a black flow preventor at the meter. One of them or any valve must have an expansion tank between them and the heater. A valve is OK, as long as you never shut it without shutting the tank off. If you want a valve to shut off the hot water, put one on the outlet.
The other thing is that gate valves have been obsolete for about 25 years since the low cost ball valves came out. For about the same price, the ball valves are quicker and easier to use, and leak less both externally and through them.
The directions aren't near explicit enough about ''The cold water gate valve must be left open while a water heater is in use.'' Water must always be free to flow back out of a heated tank. Many places are now requiring a black flow preventor at the meter. One of them or any valve must have an expansion tank between them and the heater. A valve is OK, as long as you never shut it without shutting the tank off. If you want a valve to shut off the hot water, put one on the outlet.
The other thing is that gate valves have been obsolete for about 25 years since the low cost ball valves came out. For about the same price, the ball valves are quicker and easier to use, and leak less both externally and through them.