''' Write a function that takes a DNA sequence (a string of characters A, T, C, G) and returns a dictionary with the counts of each nucleotide. Handle invalid characters by ignoring them. Provide an option to return the counts as a percentage of the total number of nucleotides. Example outputs: dna_count("ATCGATCGAATCGA") # Returns {'A': 5, 'T': 3, 'C': 4, 'G': 3} dna_count("ATCGATCGAATCGA", percent=True) # Returns {'A': 0.357, 'T': 0.214, 'C': 0.286, 'G': 0.214} ''' # Your code here