A writ of habeas corpus orders the custodian of an individual in custody to produce the individual before the court to make an inquiry concerning his or her detention, to appear for prosecution (ad prosequendum) or to appear to testify (ad testificandum).