You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: froms.rb
    path of file: ./repos/gitlabhq/lib/gitlab/database/query_analyzers/prevent_set_operator_mismatch
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module Database
    module QueryAnalyzers
      class PreventSetOperatorMismatch
        class Froms
          class << self
            # Parse the FROM part of the SELECT. Construct a mapping of FROM names to their PgQuery node. Recurse any
        
    
            def references(node, cte_refs)
              refs = {}

              return refs unless node

              node.from_clause.each do |from|
                range_var = Node.dig(from, :range_var)
                range_sq = Node.dig(from, :range_subselect)

                if range_var
                  # FROM some_table
                  # FROM some_table some_alias
                  refs.merge!(range_var_reference(range_var, cte_refs))
                elsif Node.dig(from, :join_expr)
                  # FROM some_table INNER JOIN other_table
                  range_vars = Node.locate_descendants(from, :range_var)
                  range_vars.each do |range_var|
                    refs.merge!(range_var_reference(range_var, cte_refs))
                  end
                elsif range_sq
                  # FROM (SELECT ...) some_alias
                  select_stmt = Node.dig(range_sq, :subquery, :select_stmt)
                  refs[range_sq.alias.aliasname] = SelectStmt.new(select_stmt, cte_refs).types
                end
              end