def write_results(self):
    output = [{'instr_id': k, 'trajectory': v} for (k, v) in self.results.items()]
    with open(self.results_path, 'w') as f:
        json.dump(output, f)
def write_results(self):
    output = [{'instr_id': k, 'trajectory': v} for (k, v) in self.results.items()]
    with open(self.results_path, 'w') as f:
        json.dump(output, f)