If, after hearing the proofs, it appears either that no public offense has been committed or that there is not sufficient cause to believe the defendant guilty of a public offense, the magistrate shall order the complaint dismissed and the defendant to be discharged, by an indorsement on the depositions and statement, signed by the magistrate, to the following effect: “There being no sufficient cause to believe the within named A. B. guilty of the offense within mentioned, I order that the complaint be dismissed and that he or she shall be discharged.”