<s> """<STR_LIT>""" <EOL> import subprocess as sp <EOL> import sys <EOL> def run_shell_command ( cmd ) : <EOL> """<STR_LIT>""" <EOL> child = sp . Popen ( cmd , shell = True , stdout = sp . PIPE , stderr = sp . STDOUT ) <EOL> output = child . communicate ( ) [ <NUM_LIT:0> ] <EOL> rc = child . returncode <EOL> return output , rc <EOL> def print_progression ( percent , width = <NUM_LIT:50> , delimiters = [ '<STR_LIT:[>' , '<STR_LIT:]>' ] , symbol = '<STR_LIT:#>' ) : <EOL> """<STR_LIT>""" <EOL> n_symbols = int ( percent / <NUM_LIT> * width ) <EOL> progress_bar = delimiters [ <NUM_LIT:0> ] + n_symbols * symbol + ( width - n_symbols ) * '<STR_LIT:U+0020>' + delimiters [ <NUM_LIT:1> ] + "<STR_LIT:U+0020>" <EOL> sys . stdout . write ( "<STR_LIT:\r>" + progress_bar + str ( percent ) + "<STR_LIT:%>" ) <EOL> sys . stdout . flush ( ) </s>
