(a)
(1)
(A) In any proceeding or investigation under this subchapter, if a person refuses to answer a question or produce evidence of any kind on the ground that he or she may be incriminated and if the Attorney General or prosecuting attorney requests the court in writing to order the person to answer the question or produce the evidence, the court may make this order, and the person shall comply with the order.
(B) If the court denies the request, the court shall state its reasons for the denial in writing.
(2) After complying, the testimony or evidence or any information directly derived from the testimony or evidence shall not be used against the person in any proceeding or prosecution of a crime or offense concerning which he or she gave an answer or produced evidence under the court order.
(3) Immunity obtained pursuant to this section does not exempt any person from prosecution, penalty, or forfeiture for any perjury, false swearing, or contempt committed in answering or failing to answer or in producing or failing to produce evidence in accordance with the order.
(b) If a person refuses to testify after being granted immunity and after being ordered to testify as prescribed in subsection (a) of this section, he or she may be adjudged in contempt.