#NEWLINE# @ staticmethod #NEWLINE# def checkString( s , strList , softCheck = False ) : #NEWLINE# #INDENT# '\n        Check if s is an string in strList and raise a ValueError if it is not.\n\n        :param s: The string to test. \n        :type s: :class:`str`\n\n        :param strList: A list of valid strings.\n        :type strList: :class:`list`\n        ' #NEWLINE# if ( type ( strList ) != list ) : #NEWLINE# #INDENT# return Parameter . whatToDo ( ( 'Second parameter is required to be a list: ' + str ( strList ) ) , softCheck ) #NEWLINE# #UNINDENT# if ( ( type ( s ) != str ) or ( s not in strList ) ) : #NEWLINE# #INDENT# return Parameter . whatToDo ( ( 'Invalid string: ' + str ( s ) ) , softCheck ) #NEWLINE# #UNINDENT# return True