@staticmethod
    def from_bundle(bundle_path):
        """Collect run data from two CSV files."""

        run_data = RunData(None)

        # load runs
        runs_csv_path = os.path.join(bundle_path, "all_runs.csv.gz")

        logger.info("reading run data from %s", runs_csv_path)

        solver_names = set()

        with borg.util.openz(runs_csv_path) as csv_file:
            csv_reader = csv.reader(csv_file)

            columns = csv_reader.next()

            if columns[:5] != ["instance", "solver", "budget", "cost", "succeeded"]:
                raise Exception("unexpected columns in run data CSV file")

            for (instance, solver, budget_str, cost_str, succeeded_str) in csv_reader:
                run_data.add_run(
                    instance,
                    RunRecord(
                        solver,
                        float(budget_str),
                        float(cost_str),
                        succeeded_str.lower() == "true",
                        ),
                    )
                solver_names.add(solver)

        run_data.solver_names = sorted(solver_names)

        # load features
        features_csv_path = os.path.join(bundle_path, "all_features.csv.gz")

        logger.info("reading feature data from %s", features_csv_path)

        with borg.util.openz(features_csv_path) as csv_file:
            csv_reader = csv.reader(csv_file)

            try:
                columns = csv_reader.next()
            except __HOLE__:
                pass
            else:
                if columns[0] != "instance":
                    raise Exception("unexpected columns in features CSV file")

                for row in csv_reader:
                    feature_dict = dict(zip(columns[1:], map(float, row[1:])))

                    run_data.add_feature_vector(row[0], feature_dict)

                assert set(run_data.run_lists) == set(run_data.feature_vectors)

        return run_data
dataset/ETHPy150Open borg-project/borg/borg/storage.py/RunData.from_bundle