Finds the source file of an object. Args: obj (`Any`): The object whose source file we are looking for. Returns: `Path`: The source file.
(obj: Any)
| 760 | |
| 761 | |
| 762 | def find_source_file(obj: Any) -> Path: |
| 763 | """ |
| 764 | Finds the source file of an object. |
| 765 | |
| 766 | Args: |
| 767 | obj (`Any`): The object whose source file we are looking for. |
| 768 | |
| 769 | Returns: |
| 770 | `Path`: The source file. |
| 771 | """ |
| 772 | module = obj.__module__ |
| 773 | obj_file = PATH_TO_TRANSFORMERS |
| 774 | for part in module.split(".")[1:]: |
| 775 | obj_file = obj_file / part |
| 776 | return obj_file.with_suffix(".py") |
| 777 | |
| 778 | |
| 779 | def match_docstring_with_signature(obj: Any) -> Optional[Tuple[str, str]]: |
no test coverage detected