<s> import re <EOL> import os . path <EOL> import logging <EOL> import lib . filters as filters <EOL> class TimingData : <EOL> def __init__ ( self ) : <EOL> self . data = [ ] <EOL> self . logger = logging . getLogger ( '<STR_LIT>' ) <EOL> def load_from_csv ( self , file ) : <EOL> self . full_path = file <EOL> self . file_name = os . path . basename ( file ) <EOL> self . logger . info ( "<STR_LIT>" + file ) <EOL> data_file = open ( file ) <EOL> self . parse_csv ( data_file ) <EOL> def parse_csv ( self , data ) : <EOL> if data == None or data == "<STR_LIT>" : <EOL> return <EOL> if isinstance ( data , str ) : <EOL> str_data = data . split ( '<STR_LIT:\n>' ) <EOL> else : <EOL> str_data = data . decode ( encoding = "<STR_LIT:utf-8>" ) . split ( '<STR_LIT:\n>' ) <EOL> for f in str_data : <EOL> if "<STR_LIT:;>" in str ( f ) : <EOL> s = f . split ( "<STR_LIT:;>" ) [ <NUM_LIT:0> ] <EOL> ns = f . split ( "<STR_LIT:;>" ) [ <NUM_LIT:1> ] <EOL> if ns is not None and ns != "<STR_LIT>" : <EOL> ns = int ( re . sub ( r"<STR_LIT>" , "<STR_LIT>" , ns ) ) <EOL> s = int ( re . sub ( r"<STR_LIT>" , "<STR_LIT>" , s ) ) <EOL> self . data . append ( s * <NUM_LIT> + ns ) <EOL> def quantile ( self , i ) : <EOL> return filters . PercentileFilter ( ) . apply ( self , i ) </s>
