Wiring a traffic light
It's supposed to be inside an enclosure that is earthed, or inside a case made of either two insulating layers or a reinforced insulating layer, so that a single fault will not expose any point on the outside to live current.

Using an earthed case protects you from wiring faults by triggering the GFCI when the live wire connects to the case (e.g. because a connection came loose).

The double insulated case protects you if and because it is unlikely that both layers will break at the same time (i.e. the outer layer protects the inner). Once the outer layer is broken, the device is no longer deemed safe and needs to be disconnected until it is repaired.

The lamp on its own is not a complete product and not safe to operate standalone.