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: compute_branch_stat.rb
    path of file: ./repos/powerstation/powerstation/IDE_plugin/src/main/resources/static-analyzer/controller_model_analysis
    
    the code of the file until where you have to start completion: def branch_queries
	$graph_file.puts "<branchOnQueryType>"
	@branch_on_query_cnt = Hash.new
	$node_list.each do |n|
		if n.isBranch?
			qn_list = traceback_data_dep_track_dist(n)
			qn = nil
			dist = 0
			qn_list.each do |q, d|
				if q.instance_of?INode and q.isReadQuery? and (qn == nil or q.getIndex > qn.getIndex)
					qn = q

    
def branch_queries
	$graph_file.puts "<branchOnQueryType>"
	@branch_on_query_cnt = Hash.new
	$node_list.each do |n|
		if n.isBranch?
			qn_list = traceback_data_dep_track_dist(n)
			qn = nil
			dist = 0
			qn_list.each do |q, d|
				if q.instance_of?INode and q.isReadQuery? and (qn == nil or q.getIndex > qn.getIndex)
					qn = q
					dist = d
				end
			end
			if qn
				_key = qn.getInstr.getFuncname
				if _key.include?("find_by")
					key = "find_by"
				elsif $key_words[_key]
					key = _key.gsub('?','').gsub('!','')
				else
					key = "association"
				end