Any person with an intellectual or developmental disability in a public or private residential facility for persons with an intellectual or developmental disability is entitled to file for a writ of habeas corpus upon petition by the person with an intellectual or developmental disability or a friend to any court generally empowered to issue the writ of habeas corpus in the county in which the person with an intellectual or developmental disability is detained.
T.C.A. § 52-3-501