(1) Whenever, in the course of an inquiry, a trial or any other proceeding under this Code it appears to a District Magistrate, a Court of Sessions or the High Court that the examination of a witness is necessary for the ends of justice and the attendance of such a witness cannot be procured without an amount of delay, expense or inconvenience...