(self, sample: "Sample")
| 410 | partial_label_match: Optional[Dict[str, str]] = None |
| 411 | |
| 412 | def matches(self, sample: "Sample"): |
| 413 | if self.name is not None: |
| 414 | if self.name != sample.name: |
| 415 | return False |
| 416 | |
| 417 | if self.value is not None: |
| 418 | if self.value != sample.value: |
| 419 | return False |
| 420 | |
| 421 | if self.partial_label_match is not None: |
| 422 | for label, value in self.partial_label_match.items(): |
| 423 | if sample.labels.get(label) != value: |
| 424 | return False |
| 425 | |
| 426 | return True |
| 427 | |
| 428 | |
| 429 | @dataclass |