def sanitize_word(s):
    s = re.sub('[^\w-]+', '_', s)
    s = re.sub('__+', '_', s)
    return s.strip('_')
Remove non-alphanumerical characters from metric word.
dataset/ETHPy150Open BrightcoveOS/Diamond/src/collectors/jcollectd/jcollectd.py/sanitize_word