<s> import json <EOL> import os <EOL> import sys <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> client = client_module . RestApiClient ( version = '<STR_LIT>' ) <EOL> setup_data ( client ) <EOL> print ( "<STR_LIT>" ) <EOL> response = client . call_api ( <EOL> '<STR_LIT>' , '<STR_LIT:GET>' ) <EOL> SampleUtilities . pretty_print_response ( response ) <EOL> response = client . call_api ( <EOL> '<STR_LIT>' , '<STR_LIT:GET>' ) <EOL> response_body = json . loads ( response . read ( ) . decode ( '<STR_LIT:utf-8>' ) ) <EOL> data = response_body [ '<STR_LIT:data>' ] <EOL> print ( "<STR_LIT>" ) <EOL> update_reference_map ( get_second_shift_schedule_from_hr ( ) , data , client ) <EOL> response = client . call_api ( <EOL> '<STR_LIT>' , '<STR_LIT:GET>' ) <EOL> SampleUtilities . pretty_print_response ( response ) <EOL> response = client . call_api ( <EOL> '<STR_LIT>' , '<STR_LIT:GET>' ) <EOL> response_body = json . loads ( response . read ( ) . decode ( '<STR_LIT:utf-8>' ) ) <EOL> data = response_body [ '<STR_LIT:data>' ] <EOL> print ( "<STR_LIT>" ) <EOL> update_reference_map ( get_third_shift_schedule_from_hr ( ) , data , client ) <EOL> response = client . call_api ( <EOL> '<STR_LIT>' , '<STR_LIT:GET>' ) <EOL> SampleUtilities . pretty_print_response ( response ) <EOL> def setup_data ( client ) : <EOL> SampleUtilities . data_setup ( <EOL> client , <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' , '<STR_LIT:POST>' ) <EOL> SampleUtilities . data_setup ( <EOL> client , <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' , '<STR_LIT:POST>' ) <EOL> SampleUtilities . data_setup ( <EOL> client , <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' , '<STR_LIT:POST>' ) <EOL> SampleUtilities . data_setup ( <EOL> client , <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' , '<STR_LIT:POST>' ) <EOL> SampleUtilities . data_setup ( <EOL> client , <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' , '<STR_LIT:POST>' ) <EOL> def get_second_shift_schedule_from_hr ( ) : <EOL> return { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> def get_third_shift_schedule_from_hr ( ) : <EOL> return { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> def update_reference_map ( new_shift , current_shift , client ) : <EOL> for server_ip in current_shift . keys ( ) : <EOL> if ( server_ip not in new_shift . keys ( ) ) : <EOL> client . call_api ( <EOL> '<STR_LIT>' + <EOL> server_ip + '<STR_LIT>' + current_shift [ server_ip ] [ '<STR_LIT:value>' ] , <EOL> '<STR_LIT>' ) <EOL> for server_ip in new_shift . keys ( ) : <EOL> client . call_api ( <EOL> '<STR_LIT>' + <EOL> server_ip + '<STR_LIT>' + new_shift [ server_ip ] , '<STR_LIT:POST>' ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
