code: def set_cte(self, cte_id, sql):
          
          for cte in self.extra_ctes:
              if cte['id'] == cte_id:
                  cte['sql'] = sql
                  break
          else:
              self.extra_ctes.append(
                  {'id': cte_id, 'sql': sql}
              )
docs: This is the equivalent of what self.extra_ctes[cte_id] = sql would
          do if extra_ctes were an OrderedDict