def translate_cdna(
        cdna_sequence,
        first_codon_is_start=False,
        mitochondrial=False):
    """
    Given a cDNA sequence which is aligned to a reading frame, returns
    the translated protein sequence and a boolean flag indicating whether
    the translated sequence ended on a stop codon (or just ran out of codons).

    Parameters
    ----------
    cdna_sequence : str
        cDNA sequence which is expected to start and end on complete codons.

    first_codon_is_start : bool

    mitochondrial : bool
        Use the mitochondrial codon table instead of standard
        codon to amino acid table.
    """
    # once we drop some of the prefix nucleotides, we should be in a reading frame
    # which allows us to translate this protein
    if mitochondrial:
        genetic_code = vertebrate_mitochondrial_genetic_code
    else:
        genetic_code = standard_genetic_code_with_extra_start_codons

    return genetic_code.translate(
        cdna_sequence=cdna_sequence,
        first_codon_is_start=first_codon_is_start)