(1) The governing authorities of municipalities shall have the power to construct and maintain a municipal prison, and to regulate the keeping of the same and the prisoners therein, and to contract with the board of supervisors, which is empowered in the premises, for the use of the county jail by the municipality; and to provide for the working of the streets by municipal prisoners, and to contract with the county for such work by county prisoners or the working of county roads by municipal prisoners, or for working same on the county farms. Municipal prisoners shall be worked on county roads or county farms only in the county in which the municipality is situated. Males and females shall be confined in separate cells or compartments.
(2) The municipality shall pay the tuition, living and travel expenses incurred by a person attending and participating in the basic and continuing education courses for jail officers.