Whenever, in the course of an inquiry or a trial or any other proceeding under this Code before any Magistrate other than a District Magistrate, it appears that a commission ought to be issued for the examination of a witness whose evidence is necessary for the ends of justice, and that the attendance of such witness cannot be procured without ...