It is a carbide lamp generator or a carbide gas generator from the early 1900s. In these devices water dripped onto calcium carbide. The reaction produced acetylene gas. The gas was used for lighting in homes, on bicycles, horse-drawn vehicles, mining, or railway work before electric lighting became widespread.
The vented top and the two-part body are consistent with that type of equipment.