code: def setting_str_to_bool(s):
      
      if isinstance(s, six.string_types):
          s = s.lower()
          if s == 'true':
              return True
          elif s == 'false':
              return False
          else:
              return ValueError('Invalid boolean representation: {!r}'.format(s))
      else:
          return s
docs: Converts 'true' to True and 'false' to False if s is a string