def validate_string_or_None(s):
 if (s is None):
  return None
 try:
  return six.text_type(s)
 except ValueError:
  raise ValueError((u'Could not convert "%s" to string' % s))

def validate_string_or_None ( s ) : if ( s is None ) : return None try : return six . text_type ( s ) except ValueError : raise ValueError ( ( u'Could not convert "%s" to string' % s ) )
convert s to string or raise .