MCPcopy Create free account
hub / github.com/scanny/python-pptx / snippet_seq

Function snippet_seq

tests/unitutil/file.py:21–32  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

19
20
21def 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
35def snippet_text(snippet_file_name: str):

Callers 9

flat_fixtureMethod · 0.85
rewrite_fixtureMethod · 0.85
rewrite_fixtureMethod · 0.85
rewrite_fixtureMethod · 0.85
sp_fixtureMethod · 0.85
add_timing_fixtureMethod · 0.85
new_fixtureMethod · 0.85

Calls 2

readMethod · 0.80
splitMethod · 0.80

Tested by 9

flat_fixtureMethod · 0.68
rewrite_fixtureMethod · 0.68
rewrite_fixtureMethod · 0.68
rewrite_fixtureMethod · 0.68
sp_fixtureMethod · 0.68
add_timing_fixtureMethod · 0.68
new_fixtureMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…