<commit_before>import os
import subprocess
import xmlrpclib

class ResourcesProxy():
   def __init__(self, url, stack_name, stack_id):
      self.proxy = xmlrpclib.ServerProxy(url)      
      self.stack_name = stack_name
      self.stack_id = stack_id

   def add_node(self, n = 1):
      return self.proxy.add_node(self.stack_name, self.stack_id, n) 
       
   def remove_node(self, n = 1):
      return self.proxy.remove_node(self.stack_name, self.stack_id, n) 

   def get_resource_state(self):
      home = os.environ['HOME']
      p = subprocess.Popen([home + "/repositorios/elastichpc/beta/trials/tools/resource_state.sh","cpu"], stdout=subprocess.PIPE)
      return float(p.communicate()[0]) 

   def configure_machine_file(self):
      machinefile = open(os.environ['HOME'] + "/machinefile", "w")
      
      ips = self.proxy.get_ips(self.stack_name, self.stack_id)
      
      self.number_of_nodes = 1
      machinefile.write(ips['head_node_ip'] + ":2" + "\n")
      for machine in ips['compute_node_ips']:
         machinefile.write(machine + ":2" + "\n")
	 self.number_of_nodes += 1
      machinefile.close()
      
      return self.number_of_nodes

<commit_msg>let's make a gambi to remember, from january to december.<commit_after>import os
import subprocess
import xmlrpclib

class ResourcesProxy():
   def __init__(self, url, stack_name, stack_id):
      self.proxy = xmlrpclib.ServerProxy(url)      
      self.stack_name = stack_name
      self.stack_id = stack_id

   def add_node(self, n = 1):
      return self.proxy.add_node(self.stack_name, self.stack_id, n) 
       
   def remove_node(self, n = 1):
      return self.proxy.remove_node(self.stack_name, self.stack_id, n) 

   def get_resource_state(self):
      home = os.environ['HOME']
      p = subprocess.Popen([home + "/repositorios/elastichpc/beta/trials/tools/resource_state.sh","cpu"], stdout=subprocess.PIPE)
      return float(p.communicate()[0]) 

   def configure_machine_file(self):
      machinefile = open(os.environ['HOME'] + "/machinefile_new", "w")
      
      ips = self.proxy.get_ips(self.stack_name, self.stack_id)
      
      self.number_of_nodes = 1
      machinefile.write(ips['head_node_ip'] + ":2" + "\n")
      for machine in ips['compute_node_ips']:
         machinefile.write(machine + ":2" + "\n")
	 self.number_of_nodes += 1
      machinefile.close()
      
      os.rename(os.environ['HOME'] + "/machinefile_new", os.environ['HOME'] + "/machinefile")

      return self.number_of_nodes


{'fraction_non_alphanumeric': 0.13085234093637454, 'fraction_numerical': 0.0056022408963585435, 'mean_word_length': 3.187604690117253, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '6638167', 'n_tokens_mistral': 865, 'n_tokens_neox': 842, 'n_words': 155}