Any judge before whom a person who has been committed upon a criminal charge may be brought on a writ of habeas corpus, if the same is bailable, may take an undertaking of bail from such person as in other cases, and file the same in the proper court. Whenever a writ of habeas corpus is returned to a court for hearing and the petitioner is charged with an offense other than a crime of violence or committed with a deadly weapon or involving the forcible taking or destruction of the property of another, but the prisoner does not stand convicted of any offense, the amount of the bail must be set immediately if no bail has theretofore been fixed.
Ca. Pen. Code § 1491