code: def _bool_encode(self, d):
          
          for k, v in d.items():
              if isinstance(v, bool):
                  d[k] = str(v).lower()
          
          return d
docs: Converts bool values to lowercase strings