<s> from __future__ import absolute_import , print_function , division <EOL> import os <EOL> import subprocess <EOL> def subprocess_Popen ( command , ** params ) : <EOL> """<STR_LIT>""" <EOL> startupinfo = None <EOL> if os . name == '<STR_LIT>' : <EOL> startupinfo = subprocess . STARTUPINFO ( ) <EOL> try : <EOL> startupinfo . dwFlags |= subprocess . STARTF_USESHOWWINDOW <EOL> except AttributeError : <EOL> startupinfo . dwFlags |= subprocess . _subprocess . STARTF_USESHOWWINDOW <EOL> params [ '<STR_LIT>' ] = True <EOL> stdin = None <EOL> if "<STR_LIT>" not in params : <EOL> stdin = open ( os . devnull ) <EOL> params [ '<STR_LIT>' ] = stdin . fileno ( ) <EOL> try : <EOL> proc = subprocess . Popen ( command , startupinfo = startupinfo , ** params ) <EOL> finally : <EOL> if stdin is not None : <EOL> del stdin <EOL> return proc <EOL> def call_subprocess_Popen ( command , ** params ) : <EOL> """<STR_LIT>""" <EOL> if '<STR_LIT>' in params or '<STR_LIT>' in params : <EOL> raise TypeError ( "<STR_LIT>" ) <EOL> with open ( os . devnull , '<STR_LIT:wb>' ) as null : <EOL> params . setdefault ( '<STR_LIT>' , null ) <EOL> params [ '<STR_LIT>' ] = null <EOL> params [ '<STR_LIT>' ] = null <EOL> p = subprocess_Popen ( command , ** params ) <EOL> returncode = p . wait ( ) <EOL> return returncode <EOL> def output_subprocess_Popen ( command , ** params ) : <EOL> """<STR_LIT>""" <EOL> if '<STR_LIT>' in params or '<STR_LIT>' in params : <EOL> raise TypeError ( "<STR_LIT>" ) <EOL> if not hasattr ( params , '<STR_LIT>' ) : <EOL> null = open ( os . devnull , '<STR_LIT:wb>' ) <EOL> params [ '<STR_LIT>' ] = null <EOL> params [ '<STR_LIT>' ] = subprocess . PIPE <EOL> params [ '<STR_LIT>' ] = subprocess . PIPE <EOL> p = subprocess_Popen ( command , ** params ) <EOL> out = p . communicate ( ) <EOL> return out + ( p . returncode , ) </s>
