def quoted(s):
    # strip any existing quotes
    s = s.strip(u'"')
    if u' ' in s or u'/' in s:
        return u'"%s"' % s
    else:
        return s
quotes a string if necessary.
dataset/ETHPy150Open ContinuumIO/menuinst/menuinst/win32.py/quoted