<s> import sys , os <EOL> from pyral import Rally , rallyWorkset <EOL> def main ( args ) : <EOL> options = [ opt for opt in args if opt . startswith ( '<STR_LIT>' ) ] <EOL> args = [ arg for arg in args if arg not in options ] <EOL> server , username , password , apikey , workspace , project = rallyWorkset ( options ) <EOL> if apikey : <EOL> rally = Rally ( server , apikey = apikey , workspace = workspace , project = project ) <EOL> else : <EOL> rally = Rally ( server , user = username , password = password , workspace = workspace , project = project ) <EOL> rally . enableLogging ( '<STR_LIT>' ) <EOL> for workspace in rally . getWorkspaces ( ) : <EOL> print "<STR_LIT>" % ( workspace . oid , workspace . Name ) <EOL> for project in rally . getProjects ( workspace = workspace . Name ) : <EOL> print "<STR_LIT>" % ( project . oid , project . Name , project . State ) <EOL> print "<STR_LIT>" <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( sys . argv [ <NUM_LIT:1> : ] ) </s>
