§ 14-154. Persons not to be detained. a. Definitions. For the purposes of this section, the following terms shall have the following meanings:

1. “Civil immigration detainer” shall mean a detainer issued pursuant to 8 C.F.R. 287.7.

2. “Convicted of a covered crime” shall mean a final judgment of guilt entered on a covered crime, including a conditional discharge pursuant to section 410.10 of the criminal procedure law, or a comparable provision of federal law or the law of another state. A person shall not be considered convicted of a covered crime if that person:

i. was adjudicated as a youthful offender, pursuant to article seven hundred twenty of the criminal procedure law, or a comparable status pursuant to federal law or the law of another state, or a juvenile delinquent, as defined by subdivision one of section 301.2 of the family court act, or a comparable status pursuant to federal law or the law of another state; or

ii. has never had a final judgment of guilt entered against him or her on a felony and has not had a final judgment of guilt entered against him or her on a misdemeanor that is a covered crime for at least ten years prior to the date of the instant arrest.

3. “Covered crime” shall mean a misdemeanor or felony charge brought in any of the criminal courts of the state of New York, as defined in section 10.10 of the criminal procedure law, or any other court of competent jurisdiction in the United States, provided, however, that a charge brought pursuant to section 230.00 of the penal law, section 240.37 of the penal law, except when such charge relates to the patronizing of a prostitute, or subdivision one or subparagraph (i) or (iv) of paragraph (a) of subdivision two of section five hundred eleven of the vehicle and traffic law, or a comparable provision of federal law or the law of another state, shall not be deemed a covered crime.

4. “Covered criminal case” shall mean a case in any of the criminal courts of the state of New York, as defined in section 10.10 of the criminal procedure law, or any other court of competent jurisdiction in the United States, excluding the family court of the state of New York or a comparable court in another jurisdiction in the United States, where any felony charge, or a misdemeanor charge pursuant to any of the following provisions, or a comparable provision of federal law or the law of another state, is pending:

A. section 120.00 of the penal law, unless the defendant is ordered by the court to be released for failure to replace the misdemeanor complaint with an information pursuant to section 170.70 of the criminal procedure law;

B. article one hundred thirty of the penal law;

C. section 265.01 of the penal law, provided that such charge relates to possession of a firearm, rifle, shotgun, bullet or ammunition;

D. section 215.50 of the penal law, unless the defendant is ordered by the court to be released for failure to replace the misdemeanor complaint with an information pursuant to section 170.70 of the criminal procedure law; or

E. article thirty-one of the vehicle and traffic law.

5. “Federal immigration authorities” shall mean any officer, employee or person otherwise paid by or acting as an agent of United States immigration and customs enforcement or any division thereof or any other officer, employee or person otherwise paid by or acting as an agent of the United States department of homeland security who is charged with enforcement of the civil provisions of the immigration and nationality act.

6. (i) “Pending covered criminal case” shall mean a covered criminal case where judgment has not been entered.