Restores the original order of a new array based on the old array's order Args: newarr (List[Any]): The array to be restored Returns: List[Any]: The array restored to the original order
(self, newarr)
| 193 | return [x[1] for x in self.arr] |
| 194 | |
| 195 | def get_original(self, newarr): |
| 196 | """Restores the original order of a new array based on the old array's order |
| 197 | |
| 198 | Args: |
| 199 | newarr (List[Any]): The array to be restored |
| 200 | |
| 201 | Returns: |
| 202 | List[Any]: The array restored to the original order |
| 203 | """ |
| 204 | res = [None] * self.size |
| 205 | cov = [False] * self.size |
| 206 | |
| 207 | for (inds, _), v in zip(self.arr, newarr): |
| 208 | for ind in inds: |
| 209 | res[ind] = v |
| 210 | cov[ind] = True |
| 211 | |
| 212 | assert all(cov) |
| 213 | |
| 214 | return res |
| 215 | |
| 216 | |
| 217 | def make_table(result_dict, column: str = "results"): |
no outgoing calls
no test coverage detected