code: def _all_reads_from_contig(self, contig, fout):
          '''Gets all reads from contig called "contig" and writes to fout'''
          sam_reader = pysam.Samfile(self.bam, "rb")
          for read in sam_reader.fetch(contig):
              print(mapping.aligned_read_to_read(read, ignore_quality=not self.fastq_out), file=foutf _all_reads_from_contig(self, contig, fout):
          '''Gets all reads from contig called "contig" and writes to fout'''
          sam_reader = pysam.Samfile(self.bam, "rb")
          for read in sam_reader.fetch(contig):
              print(mapping.aligned_read_to_read(read, ignore_quality=not self.fastq_out), file=fout)
docs: Gets all reads from contig called "contig" and writes to fout