Section 11. A justice of the supreme judicial or the superior court, upon the application of a magistrate or tribunal authorized to summon and compel the attendance of witnesses may, in his discretion, compel the giving of testimony by them before such magistrate or tribunal, in the same manner and to the same extent as before said courts.