(docstring)
| 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 |
no test coverage detected