def create_flanking_regions_fasta(genome, dataframe, flanking_region_size):
    """
    Makes batch processing possible, pulls down small
    region of genome for which to design primers around.
    This is based on the chromosome and position of input file.
    Each Fasta record  will contain:
    >Sample_Gene_chr:pos__
    Seq of flanking region

    Args:
        genome (list): genome list of tuples (header, seq).
        dataframe (pandas object): dataframe with sample info.
        flanking_region_size (int): length of sequence upstream and downstream of
        input coordindate position to pull as sequence to design primers around.
    Returns:
        output (list): list of tuples with (header, seq) where seq is flanking region
        and header is sample ID.
    """
    output = []
    for headers, seqs in genome:
        chrm = str(headers)
        seq = str(seqs)
        for gene, sample, chrom, pos in zip(dataframe.Gene, dataframe.Sample,
                                            dataframe.Chr, dataframe.Pos):
            if str(chrom) == chrm:
                header = str(str(sample)+"_"+str(gene)+"_"+str(chrom)+":"+str(pos)+"__")
                flank_seq = seq[int(pos)-int(flanking_region_size):\
                                    int(pos)+int(flanking_region_size)]
                output.append((header, flank_seq.upper()))
    return output