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

Method _to_dict

src/licensedcode/models.py:423–435  ·  view source on GitHub ↗

Return a mapping of license data. ``include_field(name, value)`` is a callable that will be called with each name, value pair and returns True to include the field or False to filter it.

(self, include_field)

Source from the content-addressed store, hash-verified

421 return newl
422
423 def _to_dict(self, include_field):
424 """
425 Return a mapping of license data.
426 ``include_field(name, value)`` is a callable that will be called with
427 each name, value pair and returns True to include the field or False
428 to filter it.
429 """
430 data = {}
431 for name, value in attr.asdict(self).items():
432 if not include_field(name, value):
433 continue
434 data[name] = value
435 return data
436
437 def to_dict(
438 self,

Callers 2

to_dictMethod · 0.95
to_referenceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected