MCPcopy Create free account
hub / github.com/ModalityDance/Omni-R1 / find_source_file

Function find_source_file

src/transformers/utils/check_docstrings.py:762–776  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

760
761
762def 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
779def match_docstring_with_signature(obj: Any) -> Optional[Tuple[str, str]]:

Callers 2

fix_docstringFunction · 0.85
check_docstringsFunction · 0.85

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected