#NEWLINE# def get_translations( self , laboratory_id , **kwargs ) : #NEWLINE# #INDENT# if ( not self . translation_url ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# translations = VIRTUAL_LABS . rlms_cache . get ( 'translations' ) #NEWLINE# if translations : #NEWLINE# #INDENT# return translations #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# r = VIRTUAL_LABS . cached_session . get ( response . translation_url ) #NEWLINE# r . raise_for_status ( ) #NEWLINE# translations_json = r . json ( ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# traceback . print_exc ( ) #NEWLINE# response = { #NEWLINE# #INDENT# 'error' : unicode ( e ) , #NEWLINE# #UNINDENT# } #NEWLINE# VIRTUAL_LABS . rlms_cache [ 'translations' ] = response #NEWLINE# return response #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# VIRTUAL_LABS . rlms_cache [ 'translations' ] = translations_json #NEWLINE# return translations_json