Returns a list of values associated with the given TOSA specification. The specification is normalized to its canonical form, which means that only the version and profiles are considered, without extensions.
(self, spec: "TosaSpecification")
| 62 | return [spec] |
| 63 | |
| 64 | def get(self, spec: "TosaSpecification") -> List[T]: |
| 65 | """Returns a list of values associated with the given TOSA |
| 66 | specification. |
| 67 | |
| 68 | The specification is normalized to its canonical form, which means that |
| 69 | only the version and profiles are considered, without extensions. |
| 70 | |
| 71 | """ |
| 72 | |
| 73 | base_specs = self._get_base_specs(spec) |
| 74 | result: List[T] = [] |
| 75 | for base in base_specs: |
| 76 | norm_base = base._canonical_key() |
| 77 | result.extend(self._mapping.get(norm_base, [])) |
| 78 | if len(result) == 0: |
| 79 | raise KeyError(f"No values found for TOSA specification: {spec}") |
| 80 | |
| 81 | return result # Do not deduplicate with set(), as values may be unhashable |
| 82 | |
| 83 | |
| 84 | class TosaSpecification: |