code: def validate(self, instance, value):                                       #pylint: disable=inconsistent-return-statements
          
          if not isinstance(value, string_types):
              self.error(instance, value)
          for key, val in self.choices.items():
              test_value = value if self.case_sensitive else value.upper()
              test_key = key if self.case_sensitive else key.upper()
              test_val = val if self.case_sensitive else [_.upper() for _ in val]
              if test_value == test_key or test_value in test_val:
                  return key
          self.error(instance, value, extra='Not an available choice.')
docs: Check if input is a valid string based on the choices