; and (ii) determine whether to enter a sealing order for the individual in accordance with paragraph (3). (B) Opportunity to testify and offer evidence (i) Petitioner The petitioner may testify or offer evidence at the sealing hearing in support of sealing. (ii) Prosecutor The office of a United States attorney that receives notice under paragraph (1)(A) may send a representative to testify or offer evidence at the sealing hearing in support of or against sealing. (iii) Other individuals An individual who receives notice under paragraph (1)(B) may testify or offer evidence at the sealing hearing as to the issues described in clauses (i) and (ii) of that paragraph. (C) Magistrate judges A magistrate judge may preside over a hearing under this paragraph. (D) Waiver of hearing If the petitioner and the United States attorney that receives notice under paragraph (1)(A) so agree, the court shall make a determination under paragraph (3) without a hearing. (3) Basis for decision (A) In general In determining whether to enter a sealing order with respect to protected information relating to a covered nonviolent offense, the court— (i) shall consider— (I) the petition and any documents in the possession of the court; and (II) all the evidence and testimony presented at the sealing hearing, if such a hearing is conducted; (ii) may not consider any non-Federal nonviolent crimes for which the petitioner has been arrested or proceeded against, or of which the petitioner has been convicted; and (iii) shall balance— (I) (aa) the interest of public knowledge and safety; and (bb) the legitimate interest, if any, of the Government in maintaining the accessibility of the protected information, including any potential impact of sealing the protected information on Federal licensure, permit, or employment restrictions; against (II) (aa) the conduct and demonstrated desire of the petitioner to be rehabilitated and positively contribute to the community