code: def CleanString(s):
      
      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)
docs: Cleans up string.
  
      Doesn't catch everything, appears to sometimes allow double underscores
      to occur as a result of replacements.