def quotify_list(words):
 wordout = []
 for word in words:
  qtype = q
  if (word and (not re.search('[\\s\\"\\\']', word))):
   qtype = ''
  elif ((q in word) and (qq not in word)):
   qtype = qq
  wordout.append(quotify(qtype, word, True))
 return ' '.join(wordout)

def quotify_list ( words ) : wordout = [ ] for word in words : qtype = q if ( word and ( not re . search ( '[\\s\\"\\\']' , word ) ) ) : qtype = '' elif ( ( q in word ) and ( qq not in word ) ) : qtype = qq wordout . append ( quotify ( qtype , word , True ) ) return ' ' . join ( wordout )
return a minimally-quoted string produced by quoting each word .