code: def quoted(s):
      
      # strip any existing quotes
      s = s.strip(u'"')
      # don't add quotes for minus or leading space
      if s[0] in (u'-', u' '):
          return s
      if u' ' in s or u'/' in s:
          return u'"%s"' % s
      else:
          return s
docs: quotes a string if necessary.