<commit_before>import sys
import DiffusionModel


def read_graph_with_status(nodes_file, edges_file, status_file):
	# generate the graph
	model = DiffusionModel.MultiPlayerLTModel(nodes_file, edges_file, player_num=1)

	# store the status of nodes in graph
	nodes_list = list()
	with open(status_file,'r') as f:
		while True:
			line = f.readline()
  	    if not line:
  	    	break
  		nodes = line.strip().split()
  		for n in nodes:
    	nodes_list.append(int(n))
    for n in nodes_list:
    	model.g.node[n]['status'] = 'activated'

	# return a directed graph
	return model.g


def write_result(selected_nodes_list, selected_nodes_file):
	# write selected nodes to file
	with open(selected_nodes_file, 'w') as f:
		for node in selected_nodes_list:
			f.write('%s ' %node)


if __name__ == '__main__':
	player_id = sys.argv[1]
	nodes_file = sys.argv[2]
	edges_file = sys.argv[3]
	status_file = sys.argv[4]
	nodes_num_per_iter = int(sys.argv[5])
	selected_nodes_file = sys.argv[6]
	time_limit_in_sec = sys.argv[7]  

	g = read_graph_with_status(nodes_file, edge_file, status_file)  
  
	#......

	write_result(selected_nodes_list, selected_nodes_file)

	<commit_msg>read in the graph with status, write final result<commit_after>import sys
import DiffusionModel


def read_graph_with_status(nodes_file, edges_file, status_file):
	# generate the graph
	model = DiffusionModel.MultiPlayerLTModel(nodes_file, edges_file, player_num=1)


	# store the status of nodes in graph
	nodes_list = list()
	with open(status_file,'r') as f:
		while True:
			line = f.readline()
  	    if not line:
  	    	break
  		nodes = line.strip().split()
  		for n in nodes:
    	nodes_list.append(int(n))
    for n in nodes_list:
    	model.g.node[n]['status'] = 'activated'

	# return a directed graph
	return model.g


def write_result(selected_nodes_list, selected_nodes_file):
	# write selected nodes to file
	with open(selected_nodes_file, 'w') as f:
		for node in selected_nodes_list:
			f.write('%s ' %node)


if __name__ == '__main__':
	player_id = sys.argv[1]
	nodes_file = sys.argv[2]
	edges_file = sys.argv[3]
	status_file = sys.argv[4]
	nodes_num_per_iter = int(sys.argv[5])
	selected_nodes_file = sys.argv[6]
	time_limit_in_sec = sys.argv[7]  

	g = read_graph_with_status(nodes_file, edge_file, status_file)  
  
	#......

	write_result(selected_nodes_list, selected_nodes_file)

	
{'fraction_non_alphanumeric': 0.10821052631578948, 'fraction_numerical': 0.006736842105263158, 'mean_word_length': 4.187772925764192, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1024800', 'n_tokens_mistral': 905, 'n_tokens_neox': 870, 'n_words': 202}