MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / parent

Method parent

src/commoncode/resource.py:1509–1514  ·  view source on GitHub ↗

Return the parent Resource object for this Resource or None.

(self, codebase)

Source from the content-addressed store, hash-verified

1507 return self.has_parent() and parent_directory(self.path, with_trail=False)
1508
1509 def parent(self, codebase):
1510 """
1511 Return the parent Resource object for this Resource or None.
1512 """
1513 parent_path = self.parent_path()
1514 return parent_path and codebase.get_resource(parent_path)
1515
1516 def has_siblings(self, codebase):
1517 """

Callers 15

has_siblingsMethod · 0.95
siblingsMethod · 0.95
assembleMethod · 0.80
assembleMethod · 0.80
assembleMethod · 0.80
assembleMethod · 0.80
get_root_resourceMethod · 0.80
get_ancestorFunction · 0.80
find_root_resourceFunction · 0.80

Calls 2

parent_pathMethod · 0.95
get_resourceMethod · 0.80

Tested by

no test coverage detected