; and (5) training judges and attorneys involved in foster care and adoption cases on the findings and purposes of this Act. (e) Deadline for compliance (1) In general Except as provided in paragraph (2), an entity that receives Federal assistance and is involved with adoption or foster care placements shall comply with this section not later than 6 months after publication of the guidance referred to in subsection (c), or 1 year after the date of enactment of this Act, whichever occurs first. (2) Authority to extend deadline If a State demonstrates to the satisfaction of the Secretary of Health and Human Services that it is necessary to amend State statutory law in order to change a particular practice that is inconsistent with this section, the Secretary may extend the compliance date for the State and any entities in the State that are involved with adoption or foster care placements a reasonable number of days after the close of the 1st State legislative session beginning after the date the guidance referred to in subsection (c) is published. (3) Authority to withhold funds If a State fails to comply with this section, the Secretary may withhold payment to the State of amounts otherwise payable to the State under part B or E of title IV of the Social Security Act ( 42 U.S.C. 621 et seq., 670 et seq.), to the extent the Secretary deems the withholding necessary to induce the State into compliance with this section. (f) GAO study (1) In general Not later than 5 years after the date of enactment of this Act, the Comptroller General of the United States shall conduct a study to determine whether the States have substantially complied with this Act, including specifically whether the States have— (A) eliminated policies, practices, or statutes that deny to any otherwise qualified person the opportunity to become an adoptive or foster parent on the basis of the sexual orientation, gender identity, or marital status of the person, or the sexual orientation or gender identity of the child involved