MCPcopy Index your code
hub / github.com/python-openxml/python-docx / snippet_seq

Function snippet_seq

tests/unitutil/file.py:27–38  ·  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 = 1024)

Source from the content-addressed store, hash-verified

25
26
27def snippet_seq(name: str, offset: int = 0, count: int = 1024):
28 """
29 Return a tuple containing the unicode text snippets read from the snippet
30 file having `name`. Snippets are delimited by a blank line. If specified,
31 `count` snippets starting at `offset` are returned.
32 """
33 path = os.path.join(test_file_dir, "snippets", "%s.txt" % name)
34 with open(path, "rb") as f:
35 text = f.read().decode("utf-8")
36 snippets = text.split("\n\n")
37 start, end = offset, offset + count
38 return tuple(snippets[start:end])
39
40
41def snippet_text(snippet_file_name: str):

Callers 8

it_can_add_a_rowMethod · 0.85
it_can_add_a_columnMethod · 0.85
it_can_add_a_tableMethod · 0.85
it_can_add_a_tableMethod · 0.85
it_raises_on_tr_aboveMethod · 0.85
_snippet_tblMethod · 0.85

Calls 1

readMethod · 0.80

Tested by 8

it_can_add_a_rowMethod · 0.68
it_can_add_a_columnMethod · 0.68
it_can_add_a_tableMethod · 0.68
it_can_add_a_tableMethod · 0.68
it_raises_on_tr_aboveMethod · 0.68
_snippet_tblMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…