#NEWLINE# def validate_string( option , value ) : #NEWLINE# #INDENT# "Validates that 'value' is an instance of `basestring` for Python 2\n    or `str` for Python 3.\n    " #NEWLINE# if isinstance ( value , string_type ) : #NEWLINE# #INDENT# return option #NEWLINE# #UNINDENT# raise TypeError ( ( 'Wrong type for %s, value must be an instance of %s' % ( option , string_type . __name__ ) ) )