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

Method end

lib/matplotlib/backends/backend_svg.py:195–222  ·  view source on GitHub ↗

Close the current element (opened by the most recent call to :meth:`start`). Parameters ---------- tag Element tag. If given, the tag must match the start tag. If omitted, the current element is closed. indent : bool, defaul

(self, tag=None, indent=True)

Source from the content-addressed store, hash-verified

193 self.__data.append(text)
194
195 def end(self, tag=None, indent=True):
196 """
197 Close the current element (opened by the most recent call to
198 :meth:`start`).
199
200 Parameters
201 ----------
202 tag
203 Element tag. If given, the tag must match the start tag. If
204 omitted, the current element is closed.
205 indent : bool, default: True
206 """
207 if tag:
208 assert self.__tags, f"unbalanced end({tag})"
209 assert _escape_cdata(tag) == self.__tags[-1], \
210 f"expected end({self.__tags[-1]}), got {tag}"
211 else:
212 assert self.__tags, "unbalanced end()"
213 tag = self.__tags.pop()
214 if self.__data:
215 self.__flush(indent)
216 elif self.__open:
217 self.__open = 0
218 self.__write("/>\n")
219 return
220 if indent:
221 self.__write(self.__indentation[:len(self.__tags)])
222 self.__write(f"</{tag}>\n")
223
224 def close(self, id):
225 """

Callers 15

closeMethod · 0.95
elementMethod · 0.95
_write_metadataMethod · 0.45
_write_default_styleMethod · 0.45
_write_hatchesMethod · 0.45
_write_clipsMethod · 0.45
close_groupMethod · 0.45
draw_pathMethod · 0.45
draw_markersMethod · 0.45
draw_path_collectionMethod · 0.45

Calls 3

__flushMethod · 0.95
_escape_cdataFunction · 0.85
popMethod · 0.45

Tested by

no test coverage detected