def _shell_join(seq):
 result = []
 for word in seq:
  if isinstance(word, (tuple, MutableSequence)):
   word = _shell_join(word)
  escaped = shell_quote(word)
  result.append(escaped)
 return ' '.join(result)

def _shell_join ( seq ) : result = [ ] for word in seq : if isinstance ( word , ( tuple , MutableSequence ) ) : word = _shell_join ( word ) escaped = shell_quote ( word ) result . append ( escaped ) return ' ' . join ( result )
convert a nested list of strings to a shell command .