def run_command(command):
process = subprocess.Popen(<EOL>shlex.split(command),<EOL>stdout=subprocess.PIPE,<EOL>stderr=subprocess.PIPE,<EOL>close_fds=True)<EOL>output, stderr = [stream.decode(sys.getdefaultencoding(), '<STR_LIT:ignore>')<EOL>for stream in process.communicate()]<EOL>if process.returncode != <NUM_LIT:0>:<EOL><INDENT>raise AirflowConfigException(<EOL>"<STR_LIT>"<EOL>.format(command, process.returncode, output, stderr)<EOL>)<EOL><DEDENT>return output<EOL>
Runs command and returns stdout