Generate contexts for the examples. Yields: Dict[str, Any]: A dictionary mapping parameter names to their values for each example row.
(self)
| 118 | self.examples.append([str(value) if value is not None else "" for value in values]) |
| 119 | |
| 120 | def as_contexts(self) -> Iterable[dict[str, Any]]: |
| 121 | """Generate contexts for the examples. |
| 122 | |
| 123 | Yields: |
| 124 | Dict[str, Any]: A dictionary mapping parameter names to their values for each example row. |
| 125 | """ |
| 126 | for row in self.examples: |
| 127 | assert len(self.example_params) == len(row) |
| 128 | yield dict(zip(self.example_params, row)) |
| 129 | |
| 130 | def __bool__(self) -> bool: |
| 131 | """Check if there are any examples. |
no outgoing calls
no test coverage detected