MCPcopy Create free account
hub / github.com/numpy/numpy / doc_note

Function doc_note

numpy/ma/core.py:115–128  ·  view source on GitHub ↗

Adds a Notes section to an existing docstring.

(initialdoc, note)

Source from the content-addressed store, hash-verified

113
114
115def doc_note(initialdoc, note):
116 """
117 Adds a Notes section to an existing docstring.
118
119 """
120 if initialdoc is None:
121 return
122 if note is None:
123 return initialdoc
124
125 notesplit = re.split(r'\n\s*?Notes\n\s*?-----', inspect.cleandoc(initialdoc))
126 notedoc = "\n\nNotes\n-----\n%s\n" % inspect.cleandoc(note)
127
128 return ''.join(notesplit[:1] + [notedoc] + notesplit[1:])
129
130
131def get_object_signature(obj):

Callers 1

core.pyFile · 0.85

Calls 2

splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected