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

Method to_list

src/commoncode/resource.py:1144–1175  ·  view source on GitHub ↗

Return a list of all Resources of this Codebase as mappings.

(
        self,
        with_timing=False,
        with_info=False,
        skinny=False,
        full_root=False,
        strip_root=False,
    )

Source from the content-addressed store, hash-verified

1142 return res
1143
1144 def to_list(
1145 self,
1146 with_timing=False,
1147 with_info=False,
1148 skinny=False,
1149 full_root=False,
1150 strip_root=False,
1151 ):
1152 """
1153 Return a list of all Resources of this Codebase as mappings.
1154 """
1155 if self.has_single_resource:
1156 return [
1157 self.root.to_dict(
1158 with_timing=with_timing,
1159 with_info=with_info,
1160 skinny=skinny,
1161 # we never strip root for single res codebase
1162 full_root=full_root,
1163 strip_root=False,
1164 )
1165 ]
1166
1167 td = partial(
1168 Resource.to_dict,
1169 with_timing=with_timing,
1170 with_info=with_info,
1171 skinny=skinny,
1172 full_root=full_root,
1173 strip_root=strip_root,
1174 )
1175 return [td(r) for r in self.walk(skip_root=strip_root)]
1176
1177
1178def to_decoded_posix_path(path):

Calls 3

walkMethod · 0.95
partialFunction · 0.85
to_dictMethod · 0.45