human
Complete the below
def _trim_zeros(str_floats, na_rep='NaN'):

    ''''Trims zeros, leaving just one before the decimal points if need be.'
    '''
assistant
#Here is the Python code you requested.
    trimmed = str_floats
    def _cond(values):
        non_na = [x for x in values if (x != na_rep)]
        return ((len(non_na) > 0) and all([x.endswith('0') for x in non_na]) and (not any([(('e' in x) or ('E' in x)) for x in non_na])))
    while _cond(trimmed):
        trimmed = [(x[:(-1)] if (x != na_rep) else x) for x in trimmed]
    return [((x + '0') if (x.endswith('.') and (x != na_rep)) else x) for x in trimmed]