Yeah, it's a simple lightswitch. They use them at my university in some classrooms where they don't want the lights turned off, as well as for the hallway lights. They put computers and projectors in these rooms a while ago, as well as security cameras. They found that the security cameras didn't work with the lights off, so they installed these switches so that a set of lights would always be left on. However, seeing the projected image is a little difficult, so a prof or student (usually me, when I'm there) will use their pocketknife to turn them off and on. The ones in the halls are there so people don't screw with the hall lights as a (rather unfunny) joke. Come to think of it, they used these at my high school, as well.
If these are light switches may i suggest you invest in some additional tools. First up you will need a rubber mat and also a pair of strong rubber gloves. First stand on the mat then place the rubber gloves on hands now you are ready to attempt picking...................this erm "lock"
They're safe from electrical shock through the keyway--the actual key is metal, after all. Of course, this assumes that the switch isn't defective.
The scare quotes around "lock" is appropriate. The purpose of these isn't security, it's just to make it more difficult for people to play with the lights than it's worth. A small knife blade or a small, flat screwdriver is sufficient to pick these. Just brace the pick against the small bar in the center of the keyway, put it over the small flat lever inside the lock, and flip it to the other position.