1. Short title This Act may be cited as the Stopping Trained in America Ph.D.s From Leaving the Economy Act of 2017 or the STAPLE Act . 2. Exemption from numerical limitations on permanent residents for certain United States educated immigrants (a) Aliens not subject to direct numerical limitations Section 201(b)(1) of the Immigration and Nationality Act ( 8 U.S.C. 1151(b)(1) ) is amended by adding at the end the following: (F) Aliens who have earned a Ph.D. degree from a United States institution of higher education (as defined in section 101(a) of the Higher Education Act of 1965 ( 20 U.S.C. 1001(a) )) in a field of science, technology, engineering, or mathematics and who have an offer of employment from a United States employer in a field related to such degree. . (b) Procedure for granting immigrant status Section 204(a)(1)(F) of the Immigration and Nationality Act ( 8 U.S.C. 1154(a)(1)(F) ) is amended— (1) by striking or after 203(b)(2), ; (2) by inserting , or 201(b)(1)(F) after 203(b)(3) ; and (3) by striking Attorney General and inserting Secretary of Homeland Security . 3. Exemption from H–1B numerical limitation for certain United States educated nonimmigrants Section 214(g)(5) of the Immigration and Nationality Act ( 8 U.S.C. 1184(g)(5) ) is amended— (1) in subparagraph (B), by striking or at the end; (2) in subparagraph (C), by striking the period at the end and inserting ; or ; and (3) by adding at the end the following: (D) has earned a Ph.D. degree from a United States institution of higher education (as defined in section 101(a) of the Higher Education Act of 1965 ( 20 U.S.C. 1001(a) )) in a field of science, technology, engineering, or mathematics and with respect to whom the petitioning employer requires such education as a condition for the employment. .