All instructions given shall be in writing, unless there is a phonographic reporter present and he takes them down, in which case they may be given orally; provided however, that in all misdemeanor cases oral instructions may be given pursuant to stipulation of the prosecuting attorney and counsel for the defendant. In charging the jury the court may instruct the jury regarding the law applicable to the facts of the case, and may make such comment on the evidence and the testimony and credibility of any witness as in its opinion is necessary for the proper determination of the case and in any criminal case, whether the defendant testifies or not, his failure to explain or to deny by his testimony any evidence or facts in the case against him may be commented upon by the court. The court shall inform the jury in all cases that the jurors are the exclusive judges of all questions of fact submitted to them and of the credibility of the witnesses. Either party may present to the court any written charge on the law, but not with respect to matters of fact, and request that it be given. If the court thinks it correct and pertinent, it must be given; if not, it must be refused. Upon each charge presented and given or refused, the court must endorse and sign its decision and a statement showing which party requested it. If part be given and part refused, the court must distinguish, showing by the endorsement what part of the charge was given and what part refused.
Ca. Pen. Code § 1127