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

Method start

lib/matplotlib/backends/backend_svg.py:136–169  ·  view source on GitHub ↗

Open a new element. Attributes can be given as keyword arguments, or as a string/string dictionary. The method returns an opaque identifier that can be passed to the :meth:`close` method, to close all open elements up to and including this one. Parameters

(self, tag, attrib=None, **extra)

Source from the content-addressed store, hash-verified

134 self.__data = []
135
136 def start(self, tag, attrib=None, **extra):
137 """
138 Open a new element. Attributes can be given as keyword
139 arguments, or as a string/string dictionary. The method returns
140 an opaque identifier that can be passed to the :meth:`close`
141 method, to close all open elements up to and including this one.
142
143 Parameters
144 ----------
145 tag
146 Element tag.
147 attrib
148 Attribute dictionary. Alternatively, attributes can be given as
149 keyword arguments.
150
151 Returns
152 -------
153 An element identifier.
154 """
155 if attrib is None:
156 attrib = {}
157 self.__flush()
158 tag = _escape_cdata(tag)
159 self.__data = []
160 self.__tags.append(tag)
161 self.__write(self.__indentation[:len(self.__tags) - 1])
162 self.__write(f"<{tag}")
163 for k, v in {**attrib, **extra}.items():
164 if v:
165 k = _escape_cdata(k)
166 v = _quote_escape_attrib(v)
167 self.__write(f' {k}={v}')
168 self.__open = 1
169 return len(self.__tags) - 1
170
171 def comment(self, comment):
172 """

Callers 15

elementMethod · 0.95
_timer_startMethod · 0.45
__init__Method · 0.45
ensure_metadataMethod · 0.45
_write_metadataMethod · 0.45
_write_default_styleMethod · 0.45
_write_hatchesMethod · 0.45
_write_clipsMethod · 0.45
open_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
_quote_escape_attribFunction · 0.85

Tested by 9

test_ginputFunction · 0.36
test_waitforbuttonpressFunction · 0.36
_test_interactive_implFunction · 0.36
_test_sigint_implFunction · 0.36
custom_signal_handlerFunction · 0.36
_test_threadingFunction · 0.36