| 12 | |
| 13 | |
| 14 | class SynthTextDirectory(object): |
| 15 | def __enter__(self): |
| 16 | path = create_synthetic_text_dataset() |
| 17 | self.path = path # type: ignore (reportUninitializedInstanceVariable) |
| 18 | return self.path |
| 19 | |
| 20 | def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any): |
| 21 | del exc_type, exc_value, traceback # Unused |
| 22 | shutil.rmtree(self.path) |
| 23 | |
| 24 | |
| 25 | def create_synthetic_text_dataset(n_samples: int = 16): |
no outgoing calls