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

Method from_dict

src/commoncode/resource.py:213–220  ·  view source on GitHub ↗

Return a Header object deserialized from a `kwargs` mapping of key/values. Unknown attributes are ignored.

(cls, **kwargs)

Source from the content-addressed store, hash-verified

211
212 @classmethod
213 def from_dict(cls, **kwargs):
214 """
215 Return a Header object deserialized from a `kwargs` mapping of
216 key/values. Unknown attributes are ignored.
217 """
218 known_attributes = set(attr.fields_dict(Header))
219 kwargs = {k: v for k, v in kwargs.items() if k in known_attributes}
220 return cls(**kwargs)
221
222
223def ignore_nothing(resource, codebase):

Callers 8

to_dictMethod · 0.45
process_codebaseMethod · 0.45
_populateMethod · 0.45

Calls

no outgoing calls

Tested by 2