MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _fill

Function _fill

lib/matplotlib/backends/backend_pdf.py:94–113  ·  view source on GitHub ↗

Make one string from sequence of strings, with whitespace in between. The whitespace is chosen to form lines of at most *linelen* characters, if possible.

(strings, linelen=75)

Source from the content-addressed store, hash-verified

92
93
94def _fill(strings, linelen=75):
95 """
96 Make one string from sequence of strings, with whitespace in between.
97
98 The whitespace is chosen to form lines of at most *linelen* characters,
99 if possible.
100 """
101 currpos = 0
102 lasti = 0
103 result = []
104 for i, s in enumerate(strings):
105 length = len(s)
106 if currpos + length < linelen:
107 currpos += length + 1
108 else:
109 result.append(b' '.join(strings[lasti:i]))
110 lasti = i
111 currpos = length
112 result.append(b' '.join(strings[lasti:]))
113 return b'\n'.join(result)
114
115
116def _create_pdf_info_dict(backend, metadata):

Callers 2

pdfReprFunction · 0.85
outputMethod · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…