MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / remove_signatures

Method remove_signatures

build_scripts/pybind11_stubgen.py:453–473  ·  view source on GitHub ↗
(docstring)

Source from the content-addressed store, hash-verified

451
452 @staticmethod
453 def remove_signatures(docstring): # type: (str) ->str
454
455 if docstring is None:
456 return ""
457
458 for hook in function_docstring_preprocessing_hooks:
459 docstring = hook(docstring)
460
461 signature_regex = (
462 r"(\s*(?P<overload_number>\d+).\s*)"
463 r"?{name}\s*\((?P<args>.*)\)\s*(->\s*(?P<rtype>[^\(\)]+)\s*)?".format(
464 name=r"\w+"
465 )
466 )
467
468 lines = docstring.split("\n\n")
469 lines = filter(lambda line: line != "Overloaded function.", lines)
470
471 return "\n\n".join(
472 filter(lambda line: not re.match(signature_regex, line), lines)
473 )
474
475 @staticmethod
476 def sanitize_docstring(docstring): # type: (str) ->str

Callers 1

sanitize_docstringMethod · 0.80

Calls 2

formatMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected