Section 53A. An officer or department of any city or town, or of any regional school or other district, may accept grants or gifts of funds from the federal government and from a charitable foundation, a private corporation, or an individual, or from the commonwealth, a county or municipality or an agency thereof, and in the case of any grant or gift given for educational purposes may expend said