INNER CODE UNIT · Python
from_dict
dotnet/sdk · .github/scripts/check_vendored_files.py:81
def from_dict(cls, d: dict[str, Any], default_area_labels: object) -> "Entry":
area_labels = d.get("area_labels", default_area_labels)
return cls(
id=d["id"],
local_path=d["local_path"],
notes=d.get("notes", ""),
sources=[Source.from_dict(s) for s in d["sources"]],
area_labels=area_labels.copy() if isinstance(area_labels, list) else area_labels,
)
@property
def issue_labels(self) -> list[str]:
"""Labels applied to this entry's drift issues, sync label first."""
if not isinstance(self.area_labels, list):
raise ValueError(f"{self.id}: area_labels must be a list.")
return [ISSUE_LABEL, *self.area_labels]