<s> import sys <EOL> import os <EOL> import json <EOL> import importlib <EOL> sys . path . append ( os . path . realpath ( '<STR_LIT>' ) ) <EOL> client_module = importlib . import_module ( '<STR_LIT>' ) <EOL> SampleUtilities = importlib . import_module ( '<STR_LIT>' ) <EOL> def main ( ) : <EOL> restClient = client_module . RestApiClient ( version = '<STR_LIT>' ) <EOL> actions_endpoint = '<STR_LIT>' <EOL> SampleUtilities . pretty_print_request ( restClient , <EOL> actions_endpoint , <EOL> '<STR_LIT:GET>' ) <EOL> response = restClient . call_api ( actions_endpoint , <EOL> '<STR_LIT:GET>' ) <EOL> if ( response . code != <NUM_LIT:200> ) : <EOL> print ( '<STR_LIT>' ) <EOL> SampleUtilities . pretty_print_response ( response ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> response_body = json . loads ( response . read ( ) . decode ( '<STR_LIT:utf-8>' ) ) <EOL> total_retrieved = len ( response_body ) <EOL> print ( str ( total_retrieved ) + '<STR_LIT>' ) <EOL> action_id = None <EOL> if ( total_retrieved > <NUM_LIT:0> ) : <EOL> print ( "<STR_LIT>" ) <EOL> format_str = '<STR_LIT>' <EOL> for action in response_body : <EOL> received_id = str ( action [ '<STR_LIT:id>' ] ) <EOL> received_name = action [ '<STR_LIT:name>' ] <EOL> param_count = str ( len ( action [ '<STR_LIT>' ] ) ) <EOL> print ( format_str . format ( received_id , received_name , param_count ) ) <EOL> action_id = received_id <EOL> print ( ) <EOL> if ( action_id is not None ) : <EOL> actions_endpoint += '<STR_LIT:/>' + action_id <EOL> SampleUtilities . pretty_print_request ( restClient , <EOL> actions_endpoint , <EOL> '<STR_LIT:GET>' ) <EOL> response = restClient . call_api ( actions_endpoint , <EOL> '<STR_LIT:GET>' ) <EOL> if ( response . code != <NUM_LIT:200> ) : <EOL> print ( '<STR_LIT>' + action_id ) <EOL> SampleUtilities . pretty_print_response ( response ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> response_body = json . loads ( response . read ( ) . decode ( '<STR_LIT:utf-8>' ) ) <EOL> response_id = str ( response_body [ '<STR_LIT:id>' ] ) <EOL> print ( '<STR_LIT>' + response_id ) <EOL> else : <EOL> print ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
