def unicodeToAscii(unicodeStr):
    s = copy.copy(unicodeStr)
    while True:
        try:
            ret = codecs.encode(s, 'ascii')
            return ret
        except UnicodeEncodeError as e:
            s = s.replace(e.object[e.start:e.end], ' ')
    return None
Turns a unicode string to ascii code. When failing to do so for certain
dataset/ETHPy150Open dssg/ushine-learning/dssg/util.py/unicodeToAscii