The town may exercise, consistent with the law, any of its powers
or perform any of its functions and may participate in the financing
thereof, jointly or in cooperation, by contract or otherwise, with
any civil division, subdivision or agency of the commonwealth, another
state or of the United States government.