Return the data with just one feature example per key, sub-key. Returns: The simplified data.
(self)
| 353 | self.data = OrderedDict(sorted(self.data.items())) |
| 354 | |
| 355 | def first_data_example(self) -> Data: |
| 356 | """Return the data with just one feature example per key, sub-key. |
| 357 | |
| 358 | Returns: |
| 359 | The simplified data. |
| 360 | """ |
| 361 | out_data: Data = {} |
| 362 | for key, attribute_data in self.data.items(): |
| 363 | out_data[key] = {} |
| 364 | for sub_key, features in attribute_data.items(): |
| 365 | feature_slices = [feature[:1] for feature in features] |
| 366 | out_data[key][sub_key] = cast(List[FeatureArray], feature_slices) |
| 367 | return out_data |
| 368 | |
| 369 | def does_feature_exist(self, key: Text, sub_key: Optional[Text] = None) -> bool: |
| 370 | """Check if feature key (and sub-key) is present and features are available. |
no test coverage detected