#NEWLINE# def perform_import( val , setting_name ) : #NEWLINE# #INDENT# '\n    If the given setting is a string import notation,\n    then perform the necessary import or imports.\n    ' #NEWLINE# if ( val is None ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( val , six . string_types ) : #NEWLINE# #INDENT# return import_from_string ( val , val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( val , ( list , tuple ) ) : #NEWLINE# #INDENT# return [ import_from_string ( item , setting_name ) for item in val ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return val