Every line of 'how to make python not case sensitive' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
227 def prep_case_insensitive(value): 228 """Prepare a string for case-insensitive comparison. 229 230 This is defined in RFC4518. For simplicity, all this function does is 231 lowercase all the characters, strip leading and trailing whitespace, 232 and compress sequences of spaces to a single space. 233 """ 234 value = re.sub(r'\s+', ' ', value.strip().lower()) 235 return value
130 def test_case_insensitive_true(self): 131 """Verify that case insensitive variants of 'true' returns the True 132 boolean. 133 134 """ 135 values = ['true', 'TRUE', 'True', 'tRuE', 't', 'T', ] 136 for value in values: 137 received = str_to_bool(value) 138 self.assertTrue(received)