<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def smartquotes(text):
 """ Runs text through pandoc for smartquote correction. """

    command = shlex.split('pandoc --smart -t plain')
    com = Popen(command, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    out, err = com.communicate(text.encode('utf-8'))
    com_out = out.decode('utf-8')
    text = com_out.replace(u'\n', u' ').strip()
    return text