def CleanString(s):
    """Cleans up string.

    Doesn't catch everything, appears to sometimes allow double underscores
    to occur as a result of replacements.
    """
    punc = ' ', '-', "'", '.', '&amp;', '&', '+', '@'
    pieces = []
    for part in s.split():
        part = part.strip()
        for p in punc:
            part = part.replace(p, '_')
        part = part.strip('_')
        part = part.lower()
        pieces.append(part)
    return '_'.join(pieces)
