<commit_before>'''
Created on Feb 16, 2013

@author: alfoa
'''
import xml.etree.ElementTree as ET
from BaseType import BaseType
from Csv_loader import CsvLoader as ld
import DataSets
#from hdf5_manager import hdf5Manager as AAFManager
#import h5py as h5


class Data(BaseType):
  def __init__(self):
    BaseType.__init__(self)
    self.inputs  = []   # input  parameters
    self.outputs = []   # output parameters
    self.inpParametersValues   = {}  # input parameters as keys, corresponding values 
    self.outParametersValues   = {}  # output variables as keys, corresponding values
    self.toLoadFromList = []
  def readMoreXML(self,xmlNode):
    self.inputs  = xmlNode.find('Input' ).text.split(',')
    self.outputs = xmlNode.find('Output').text.split(',')
    try:
      time = xmlNode.attrib['time']
      if time == 'end' or time == 'all':
        self.time = time 
      else:
        try: self.time = float(time)
        except:self.time = float(time.split(','))
    except:self.time = None
    
    try:
      self.dname = xmlNode.attrib['d_name']
    except:
      self.dname = None
      
  def addInitParams(self,tempDict):
    for i in range(len(self.inputs)): 
      tempDict['Input_'+str(i)] = self.inputs[i]
    for i in range(len(self.outputs)): 
      tempDict['Output_'+str(i)] = self.outputs[i]
    tempDict['Time'] = self.time
    return tempDict

  def finalize(self):
    pass 
  def addOutput(self,toLoadFrom):
    # this function adds the file name/names to the
    # filename list
    print('toLoadFrom :')
    print(toLoadFrom)
    
    self.toLoadFromList.append(toLoadFrom)
    return
  def getInpParametersValues(self):
    return self.inpParametersValues  

  def getOutParametersValues(self):
    return self.outParametersValues 
  <commit_msg>database can be an output now... filter is missing...<commit_after>'''
Created on Feb 16, 2013

@author: alfoa
'''
import xml.etree.ElementTree as ET
from BaseType import BaseType
from Csv_loader import CsvLoader as ld
import DataSets
#from hdf5_manager import hdf5Manager as AAFManager
#import h5py as h5


class Data(BaseType):
  def __init__(self):
    BaseType.__init__(self)
    self.inputs  = []   # input  parameters
    self.outputs = []   # output parameters
    self.inpParametersValues   = {}  # input parameters as keys, corresponding values 
    self.outParametersValues   = {}  # output variables as keys, corresponding values
    self.toLoadFromList = []
  def readMoreXML(self,xmlNode):
    self.inputs  = xmlNode.find('Input' ).text.split(',')
    self.outputs = xmlNode.find('Output').text.split(',')
    try:
      time = xmlNode.attrib['time']
      if time == 'end' or time == 'all':
        self.time = time 
      else:
        try: self.time = float(time)
        except:self.time = float(time.split(','))
    except:self.time = None

  def addInitParams(self,tempDict):
    for i in range(len(self.inputs)): 
      tempDict['Input_'+str(i)] = self.inputs[i]
    for i in range(len(self.outputs)): 
      tempDict['Output_'+str(i)] = self.outputs[i]
    tempDict['Time'] = self.time
    return tempDict

  def finalize(self):
    pass 
  def addOutput(self,toLoadFrom):
    # this function adds the file name/names to the
    # filename list
    print('toLoadFrom :')
    print(toLoadFrom)
    
    self.toLoadFromList.append(toLoadFrom)
    return
  def getInpParametersValues(self):
    return self.inpParametersValues  

  def getOutParametersValues(self):
    return self.outParametersValues 
  
{'fraction_non_alphanumeric': 0.11551625784369653, 'fraction_numerical': 0.005704506560182544, 'mean_word_length': 3.220216606498195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 11}, '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': '1498428', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1097, 'n_words': 276}