<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fetch_gene_fasta(gene_bed, fasta_obj):
 """Retreive gene sequences in FASTA format. Parameters gene_bed : BedLine BedLine object representing a single gene fasta_obj : pysam.Fastafile fasta object for index retreival of sequence Returns ------- gene_fasta : str sequence of gene in FASTA format """

    gene_fasta = ''
    strand = gene_bed.strand
    exons = gene_bed.get_exons()
    if strand == '-':
        exons.reverse()  # order exons 5' to 3', so reverse if '-' strand

    # iterate over exons
    for i, exon in enumerate(exons):
        exon_seq = fasta_obj.fetch(reference=gene_bed.chrom,
                                   start=exon[0],
                                   end=exon[1]).upper()
        if strand == '-':
            exon_seq = utils.rev_comp(exon_seq)
        exon_fasta = '>{0};exon{1}\n{2}\n'.format(gene_bed.gene_name,
                                                  i, exon_seq)

        # get splice site sequence
        if len(exons) == 1:
            # splice sites don't matter if there is no splicing
            ss_fasta = ''
        elif i == 0:
            # first exon only, get 3' SS
            ss_fasta = _fetch_5ss_fasta(fasta_obj, gene_bed.gene_name, i,
                                        gene_bed.chrom, strand, exon[0], exon[1])
        elif i == (len(exons) - 1):
            # last exon only, get 5' SS
            ss_fasta = _fetch_3ss_fasta(fasta_obj, gene_bed.gene_name, i,
                                        gene_bed.chrom, strand, exon[0], exon[1])
        else:
            # middle exon, get bot 5' and 3' SS
            fasta_3ss = _fetch_3ss_fasta(fasta_obj, gene_bed.gene_name, i,
                                         gene_bed.chrom, strand, exon[0], exon[1])
            fasta_5ss = _fetch_5ss_fasta(fasta_obj, gene_bed.gene_name, i,
                                         gene_bed.chrom, strand, exon[0], exon[1])
            ss_fasta = fasta_5ss + fasta_3ss

        gene_fasta += exon_fasta + ss_fasta

    return gene_fasta