benchmarks/scripts/plotter.py
def extract_datasets(input_file: str):
    """extract datasets from the given input files"""
    datasets = {}
    with open(input_file, 'r') as file:
        curr_dataset = {}
        curr_name = 0

        for line in file:
            data = line.strip().split(' ')

            if len(data) == 2:
                curr_dataset[data[0]] = float(data[1])

            elif len(data) == 1:
                if not curr_name == 0:
                    datasets[curr_name] = curr_dataset

                curr_name = int(data[0])
                curr_dataset = {}

            else:
                raise Exception('Tryng to parse unexpected data.')

        # Adding dataset that was processed when file ended
        datasets[curr_name] = curr_dataset
    return datasets
extract datasets from the given input files
extract datasets from the given input files
extract datasets from the given input files
def extract_datasets(input_file: str):
    datasets = {}
    with open(input_file, 'r') as file:
        curr_dataset = {}
        curr_name = 0
        for line in file:
            data = line.strip().split(' ')
            if len(data) == 2:
                curr_dataset[data[0]] = float(data[1])
            elif len(data) == 1:
                if not curr_name == 0:
                    datasets[curr_name] = curr_dataset
                curr_name = int(data[0])
                curr_dataset = {}
            else:
                raise Exception('Tryng to parse unexpected data.')
        datasets[curr_name] = curr_dataset
    return datasets
def extract_datasets ( input_file : str ) : datasets = { } with open ( input_file , 'r' ) as file : curr_dataset = { } curr_name = 0 for line in file : data = line . strip ( ) . split ( ' ' ) if len ( data ) == 2 : curr_dataset [ data [ 0 ] ] = float ( data [ 1 ] ) elif len ( data ) == 1 : if not curr_name == 0 : datasets [ curr_name ] = curr_dataset curr_name = int ( data [ 0 ] ) curr_dataset = { } else : raise Exception ( 'Tryng to parse unexpected data.' ) datasets [ curr_name ] = curr_dataset return datasets
extract datasets from the given input files
extract datasets from the given input files
"""extract datasets from the given input files""" # Adding dataset that was processed when file ended
input_file
str