def write_records(records, output_file, split=False):

    """Write FASTA records

    Write a FASTA file from an iterable of records.

    Parameters
    ----------
    records : iterable
        Input records to write.
    output_file : file, str or pathlib.Path
        Output FASTA file to be written into.
    split : bool, optional
        If True, each record is written into its own separate file. Default is
        False.
    """

    if split:
        for record in records:
            with open(
                "{}{}.fa".format(output_file, record.id), "w"
            ) as record_handle:
                SeqIO.write(record, record_handle, "fasta")
    else:
        SeqIO.write(records, output_file, "fasta")
Write FASTA records

    Write a FASTA file from an iterable of records.

    Parameters
    ----------
    records : iterable
        Input records to write.
    output_file : file, str or pathlib.Path
        Output FASTA file to be written into.
    split : bool, optional
        If True, each record is written into its own separate file. Default is
        False.