<s> '''<STR_LIT>''' <EOL> from __future__ import print_function , unicode_literals , division , absolute_import <EOL> import os <EOL> import dxpy <EOL> from . . exceptions import DXError <EOL> from . search import find_one_data_object <EOL> def load_app_resource ( ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> if '<STR_LIT>' in kwargs : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> if dxpy . JOB_ID is None : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> if '<STR_LIT>' not in os . environ and '<STR_LIT>' not in os . environ : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> kwargs [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' , os . environ . get ( '<STR_LIT>' ) ) <EOL> kwargs [ '<STR_LIT>' ] = True <EOL> return find_one_data_object ( ** kwargs ) <EOL> def load_from_cache ( ** kwargs ) : <EOL> '''<STR_LIT>''' <EOL> if '<STR_LIT>' in kwargs : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> if dxpy . JOB_ID is None : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> if '<STR_LIT>' not in os . environ : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> kwargs [ '<STR_LIT>' ] = os . environ . get ( '<STR_LIT>' ) <EOL> kwargs [ '<STR_LIT>' ] = True <EOL> cached_object = find_one_data_object ( ** kwargs ) <EOL> if cached_object is None : <EOL> return None <EOL> return cached_object . clone ( dxpy . WORKSPACE_ID ) <EOL> def save_to_cache ( dxobject ) : <EOL> '''<STR_LIT>''' <EOL> if dxpy . JOB_ID is None : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> if '<STR_LIT>' not in os . environ : <EOL> raise DXError ( '<STR_LIT>' ) <EOL> dxobject . clone ( os . environ . get ( '<STR_LIT>' ) ) </s>
