348.(1) Whoever, having been convicted of an offence punishable under Chapter XII or Chapter XVII of the Penal Code, with imprisonment for a term of three years or upwards, is again accused of any offence punishable under either of those chapters with imprisonment for a term of three years or upwards, shall if the Magistrate before whom the case is pending is satisfied that there are sufficient grounds for 396[sending] the accused be 397[sent] to the Court of Session or 398[***] unless the Magistrate is competent to try the case and is of opinion that he can himself pass an adequate sentence if the accused is convicted:
Provided that, if any Magistrate in the district has been invested with powers under section 30, the case may be transferred to him instead of being 399[sent] to the Court of Session.
(2) When any person is 400[sent] to the Court of Session 401[***] under sub-section (1), any other person accused jointly with him in the same inquiry or trial shall be similarly 402[sent] unless the Magistrate discharges such other person under 403[section 241A].