; and (iii) met all of the requirements described in subparagraph (A) prior to entering that facility. (2) Homeless The term homeless means living or residing in a place not meant for human habitation, in a safe haven, or in an emergency homeless shelter. (3) Permanent supportive housing (A) In general The term permanent supportive housing means permanent, affordable housing with flexible support services that are available and designed to help the tenants stay housed and build the necessary skills to live as independently as possible. Such term does not include housing that is time-limited. Supportive housing offers residents assistance in reaching their full potential, which may include opportunities to secure other housing that meets their needs and preferences, based on individual choice instead of the requirements of time-limited transitional programs. Under this section, permanent affordable housing includes permanent housing funded or assisted through title IV of the McKinney-Vento Homeless Assistance Act ( 42 U.S.C. 11360 et seq. ) and section 8 of the United States Housing Act of 1937 ( 42 U.S.C. 1437f ). (B) Affordable For purposes of subparagraph (A), the term affordable means within the financial means of individuals who are extremely low income, as defined by the Secretary of Housing and Urban Development. (4) Substance Use Disorder Services The term substance use disorder , used with respect to services, has the meaning given the term substance abuse services in section 330(h)(5). (o) Funding (1) Authorization of appropriations For the purpose of carrying out this section, there are authorized to be appropriated such sums as may be necessary for each of fiscal years 2018 through 2023. (2) Allocation for training and technical assistance Of the amount appropriated under paragraph (1) for a fiscal year, the Secretary may reserve not more than 3 percent for carrying out subsection (l). . (b) Technical amendments to Public Health Service Act Title V of the Public Health Service Act ( 42 U.S.C. 290aa et