(a) Section four thousand eighty-five of title eighteen of the United States Code; or
(b) Subdivision two of this section. 2. When such a defendant is in federal custody as specified in subdivision one, a superior court, at a term held in the county in which the criminal action against him is pending, may, upon application of the district attorney of such county, issue a certificate, known as a writ of habeas corpus ad prosequendum, addressed to the attorney general of the United States, certifying that such defendant has been charged by the particular accusatory instrument filed against him in the specified court with the offense or offenses alleged therein, and that attendance of the defendant in such court for the purpose of criminal prosecution thereon is necessary in the interest of justice, and requesting the attorney general of the United States to cause such defendant to be produced in such court, under custody of a federal public servant, upon a designated date and for a period of time necessary to complete the prosecution. Upon issuing such a certificate, the court may deliver it, or cause or authorize it to be delivered, together with a certified copy of the accusatory instrument upon which it is based, to the attorney general of the United States or to his representative authorized to entertain the request.