When two or more persons are included in the same indictment or information, and the court is of opinion that in regard to a particular defendant there is not sufficient evidence to put him on his defense, it must, before the evidence is closed, in order that he may be compelled to be a witness for his codefendant, submit its opinion to the jury, who, if they so find, may acquit the particular defendant for the purpose aforesaid.
Okla. Stat. tit. 22, § 840