when a gas is collected over water, is the gas pure?

No. It has water vapor in it.