(a)
When the examination of witnesses on the part of the people is closed, any witness the defendant may produce shall be sworn and examined.
Upon the request of the prosecuting attorney, the magistrate shall require an offer of proof from the defense as to the testimony expected from the witness. The magistrate shall not permit the testimony of any defense witness unless the offer of proof discloses to the satisfaction of the magistrate, in his or her sound discretion, that the testimony of that witness, if believed, would be reasonably likely to establish an affirmative defense, negate an element of a crime charged, or impeach the testimony of a prosecution witness or the statement of a declarant testified to by a prosecution witness.
(b)
It is the purpose of a preliminary examination to establish whether there exists probable cause to believe that the defendant has committed a felony. The examination shall not be used for purposes of discovery.
(c)
This section shall not be construed to compel or authorize the taking of depositions of witnesses.