Return a tuple containing the unicode text snippets read from the snippet file having *name*. Snippets are delimited by a blank line. If specified, *count* snippets starting at *offset* are returned.
(name: str, offset: int = 0, count: int = sys.maxsize)
| 19 | |
| 20 | |
| 21 | def snippet_seq(name: str, offset: int = 0, count: int = sys.maxsize): |
| 22 | """ |
| 23 | Return a tuple containing the unicode text snippets read from the snippet |
| 24 | file having *name*. Snippets are delimited by a blank line. If specified, |
| 25 | *count* snippets starting at *offset* are returned. |
| 26 | """ |
| 27 | path = os.path.join(test_file_dir, "snippets", "%s.txt" % name) |
| 28 | with open(path, "rb") as f: |
| 29 | text = f.read().decode("utf-8") |
| 30 | snippets = text.split("\n\n") |
| 31 | start, end = offset, offset + count |
| 32 | return tuple(snippets[start:end]) |
| 33 | |
| 34 | |
| 35 | def snippet_text(snippet_file_name: str): |
searching dependent graphs…