<commit_before># Easily convert between different phylogenetics file formats.
#
# Authors: Dr. <NAME>
#          <NAME>
# -------------------------------------------------
# Fasta conversions
# -------------------------------------------------

from phylogenetics.base import Homolog, HomologSet

# XML parser import
from xml.etree import ElementTree as ET

class Fasta2PhylipError(Exception):
    """
    General error class for this module.
    """
    pass

def fasta2phylip(lines):
    """
    Take the lines from a fasta file and return in fasta format.
    """

    lines = [l for l in lines if l.strip() != ""]

    # Read fasta file
    out = []
    for l in lines:
        if l[0] == ">":
            if len(out) != 0:
                out.append("\n")
            out.append("%-10s" % l[1:11])<commit_msg>add regex to imports in formats<commit_after># Easily convert between different phylogenetics file formats.
#
# Authors: Dr. <NAME>
#          <NAME>
# -------------------------------------------------
# Fasta conversions
# -------------------------------------------------

import re

from phylogenetics.base import Homolog, HomologSet

# XML parser import
from xml.etree import ElementTree as ET

class Fasta2PhylipError(Exception):
    """
    General error class for this module.
    """
    pass

def fasta2phylip(lines):
    """
    Take the lines from a fasta file and return in fasta format.
    """

    lines = [l for l in lines if l.strip() != ""]

    # Read fasta file
    out = []
    for l in lines:
        if l[0] == ">":
            if len(out) != 0:
                out.append("\n")
            out.append("%-10s" % l[1:11])
{'fraction_non_alphanumeric': 0.22208811104405551, 'fraction_numerical': 0.010863005431502716, 'mean_word_length': 1.611023622047244, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1325845', 'n_tokens_mistral': 492, 'n_tokens_neox': 461, 'n_words': 156}