original_docstring: 
      Filter duplicate CTEs from the list
      If a cte occurs multiple times, then only keep the first occurrence.
      Throw an error if not all of the occurrences are the same.
      :param queries:
      :return:
      
docstring: Filter duplicate CTEs from the list
  If a cte occurs multiple times, then only keep the first occurrence.
  Throw an error if not all of the occurrences are the same.
docstring_tokens: Filter duplicate CTEs from the list If a cte occurs multiple times then only keep the first occurrence . Throw an error if not all of the occurrences are the same .
code: def _filter_duplicate_ctes(queries: List[SemiCompiledTuple]) -> List[SemiCompiledTuple]:
      """
      Filter duplicate CTEs from the list
      If a cte occurs multiple times, then only keep the first occurrence.
      Throw an error if not all of the occurrences are the same.
      :param queries:
      :return:
      """
      seen: Dict[str, str] = {}
      result = []
      for query in queries:
          if query.quoted_cte_name not in seen:
              seen[query.quoted_cte_name] = query.sql
              result.append(query)
          elif seen[query.quoted_cte_name] != query.sql:
              raise Exception(f'Encountered the CTE {query.quoted_cte_name} multiple times, but with different '
                              f'definitions. HINT: use "{{REFERENCE_UNIQUE_FIELD}}" in the sql definition '
                              f'to make CTE names unique between different instances of the same model.\n'
                              f'first: {seen[query.quoted_cte_name]}\n'
                              f'second: {query.sql}\n')
      return result
code_tokens: def _filter_duplicate_ctes ( queries : List [ SemiCompiledTuple ] ) -> List [ SemiCompiledTuple ] : seen : Dict [ str , str ] = { } result = [ ] for query in queries : if query . quoted_cte_name not in seen : seen [ query . quoted_cte_name ] = query . sql result . append ( query ) elif seen [ query . quoted_cte_name ] != query . sql : raise Exception ( f'Encountered the CTE {query.quoted_cte_name} multiple times, but with different ' f'definitions. HINT: use "{{REFERENCE_UNIQUE_FIELD}}" in the sql definition ' f'to make CTE names unique between different instances of the same model.\n' f'first: {seen[query.quoted_cte_name]}\n' f'second: {query.sql}\n' ) return result
short_docstring: Filter duplicate CTEs from the list
  If a cte occurs multiple times, then only keep the first occurrence.
short_docstring_tokens: Filter duplicate CTEs from the list If a cte occurs multiple times then only keep the first occurrence .
comment: """
      Filter duplicate CTEs from the list
      If a cte occurs multiple times, then only keep the first occurrence.
      Throw an error if not all of the occurrences are the same.
      :param queries:
      :return:
      """