<s> '''<STR_LIT>''' <EOL> import sys <EOL> import subprocess <EOL> import os <EOL> from errors import UnsupportedPackageName <EOL> def install ( packages ) : <EOL> """<STR_LIT>""" <EOL> for package , version in packages : <EOL> if version [ <NUM_LIT:0> : <NUM_LIT:2> ] != "<STR_LIT>" : <EOL> install = [ "<STR_LIT>" . format ( <EOL> package = package , <EOL> version = version <EOL> ) ] <EOL> elif version [ <NUM_LIT:0> : <NUM_LIT:2> ] == "<STR_LIT>" : <EOL> install = [ "<STR_LIT>" . format ( <EOL> package = package <EOL> ) ] <EOL> else : <EOL> raise UnsupportedPackageName ( "<STR_LIT>" . format ( <EOL> package = package <EOL> ) ) <EOL> subprocess . call ( install , shell = True ) <EOL> def uninstall ( packages ) : <EOL> """<STR_LIT>""" <EOL> for package , version in packages : <EOL> uninstall = [ "<STR_LIT>" . format ( <EOL> package = package , <EOL> version = version <EOL> ) ] <EOL> subprocess . call ( uninstall , shell = True ) <EOL> def upgrade ( packages ) : <EOL> for package , version in packages : <EOL> if version [ <NUM_LIT:0> : <NUM_LIT:2> ] == "<STR_LIT>" : <EOL> upgrade = [ "<STR_LIT>" . format ( <EOL> package = package <EOL> ) ] <EOL> subprocess . call ( upgrade , shell = True ) <EOL> def reset ( packages ) : <EOL> """<STR_LIT>""" <EOL> print "<STR_LIT>" <EOL> user_input = raw_input ( "<STR_LIT>" ) <EOL> if user_input == "<STR_LIT:y>" : <EOL> print "<STR_LIT>" <EOL> uninstall ( packages ) <EOL> print "<STR_LIT>" <EOL> os . remove ( "<STR_LIT>" ) <EOL> else : <EOL> print "<STR_LIT>" </s>
