Electron localization in models of hydrogenated amorphous silicon and pure amorphous silicon