MCPcopy Create free account
hub / github.com/apache/arrow / leave_FunctionDef

Method leave_FunctionDef

python/scripts/update_stub_docstrings.py:155–170  ·  view source on GitHub ↗
(self, original_node, updated_node)

Source from the content-addressed store, hash-verified

153 self.indentation += 1
154
155 def leave_FunctionDef(self, original_node, updated_node):
156 name = self._full_name()
157 ellipsis_func = m.FunctionDef(
158 body=m.SimpleStatementSuite(body=[m.Expr(m.Ellipsis())]))
159
160 if m.matches(original_node, ellipsis_func):
161 docstring = _get_docstring(name, self.module, self.indentation)
162 if docstring:
163 docstring_stmt = libcst.SimpleStatementLine(
164 body=[libcst.Expr(value=libcst.SimpleString(value=docstring))])
165 updated_node = updated_node.with_changes(
166 body=libcst.IndentedBlock(body=[docstring_stmt]))
167
168 self.stack.pop()
169 self.indentation -= 1
170 return updated_node
171
172
173LIB_MODULES = {"array", "builder", "compat", "config", "device", "error", "io",

Callers

nothing calls this directly

Calls 2

_full_nameMethod · 0.95
_get_docstringFunction · 0.85

Tested by

no test coverage detected