MCPcopy Index your code
hub / github.com/numpy/numpy / run

Method run

doc/source/conf.py:185–221  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

183 optional_arguments = 1
184
185 def run(self):
186 try:
187 obj = self.arguments[0]
188 except IndexError:
189 # Argument is empty; use default text
190 obj = "submodule"
191 text = (f"This {obj} is considered legacy and will no longer receive "
192 "updates. This could also mean it will be removed in future "
193 "NumPy versions.")
194
195 try:
196 self.content[0] = text + " " + self.content[0]
197 except IndexError:
198 # Content is empty; use the default text
199 source, lineno = self.state_machine.get_source_and_line(
200 self.lineno
201 )
202 self.content.append(
203 text,
204 source=source,
205 offset=lineno
206 )
207 text = '\n'.join(self.content)
208 # Create the admonition node, to be populated by `nested_parse`
209 admonition_node = self.node_class(rawsource=text)
210 # Set custom title
211 title_text = "Legacy"
212 textnodes, _ = self.state.inline_text(title_text, self.lineno)
213 title = nodes.title(title_text, '', *textnodes)
214 # Set up admonition node
215 admonition_node += title
216 # Select custom class for CSS styling
217 admonition_node['classes'] = ['admonition-legacy']
218 # Parse the directive contents
219 self.state.nested_parse(self.content, self.content_offset,
220 admonition_node)
221 return [admonition_node]
222
223
224def setup(app):

Callers 15

write_releaseFunction · 0.45
run_ruffMethod · 0.45
run_cython_lintMethod · 0.45
run_check_c_apiMethod · 0.45
diff_filesFunction · 0.45
testTensor.pyFile · 0.45
testArray.pyFile · 0.45
testSuperTensor.pyFile · 0.45
testVector.pyFile · 0.45
testMatrix.pyFile · 0.45
testFlat.pyFile · 0.45

Calls 2

joinMethod · 0.80
titleMethod · 0.80

Tested by 11

_runMethod · 0.36
test_context_localityFunction · 0.36
test_asyncio_safeMethod · 0.36
test_pyinstallerFunction · 0.36
run_mypyFunction · 0.36
check_numpyconfigMethod · 0.36
test_debugcapi_bldFunction · 0.36
test_npdistopFunction · 0.36