(a) If the criminal action was pending in supreme court or county court, such order may be issued by a justice of the appellate division of the department in which the conviction was entered.
(b) If the criminal action was pending in a local criminal court, such order may be issued by a judge of a superior court holding a term thereof in the county in which the conviction was entered. 3. An application for an order specified in this section must be made upon reasonable notice to the people, and the people must be accorded adequate opportunity to appear in opposition thereto. Not more than one application may be made pursuant to this section. Defendant must allege in his application that he intends to take an appeal to an intermediate appellate court immediately after sentence is pronounced. 4. Notwithstanding the provisions of subdivision one, if within thirty days after sentence the defendant has not taken an appeal to an intermediate appellate court from the judgment or sentence, the operation of such order terminates and the defendant must surrender himself to the criminal court in which the judgment was entered in order that execution of the judgment be commenced. 5. Notwithstanding the provisions of subdivision one, if within one hundred twenty days after the filing of the notice of appeal such appeal has not been brought to argument in or submitted to the intermediate appellate court, the operation of such order terminates and the defendant must surrender himself to the criminal court in which the judgment was entered in order that execution of the judgment be commenced or resumed; except that this subdivision does not apply where the intermediate appellate court has (a) extended the time for argument or submission of the appeal to a date beyond the specified period of one hundred twenty days, and (b) upon application of the defendant, expressly ordered that the operation of the order continue until the date of the determination of the appeal or some other designated future date or occurrence. 6. Where the defendant is at liberty during the pendency of an appeal as a result of an order issued pursuant to this section, the intermediate appellate court, upon affirmance of the judgment, must by appropriate certificate remit the case to the criminal court in which such judgment was entered. The criminal court must, upon at least two days notice to the defendant, his surety and his attorney, promptly direct the defendant to surrender himself to the criminal court in order that execution of the judgment be commenced or resumed, and if necessary the criminal court may issue a bench warrant to secure his appearance.