def fix_filename(s):
        t = s.translate(s.maketrans(BAD_FILECHARS, GOOD_FILECHARS))
        if t.count('.') > 1:
            for i in range(t.count('.') - 1):
                idot = t.find('.')
                t = "%s_%s" % (t[:idot], t[idot+1:])
        return t
fix string to be a 'good' filename.
dataset/ETHPy150Open xraypy/xraylarch/plugins/io/fileutils.py/fix_filename