MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / propagate_ids

Method propagate_ids

scripts/openapi.py:2050–2071  ·  view source on GitHub ↗
(cls, classes: dict[str, Any])

Source from the content-addressed store, hash-verified

2048
2049 @classmethod
2050 def propagate_ids(cls, classes: dict[str, Any]) -> bool:
2051 updated = False
2052
2053 def get_ids(class_name: str) -> list[str]:
2054 clazz = classes.get(class_name, {})
2055 ids = clazz.get("ids", [])
2056 if ids:
2057 return ids
2058 for base in clazz.get("bases", []):
2059 ids = get_ids(base)
2060 if ids:
2061 return ids
2062 return []
2063
2064 for name, clazz in sorted(classes.items(), key=lambda v: v[0]):
2065 if not clazz.get("ids", []):
2066 base_ids = get_ids(name)
2067 if base_ids:
2068 clazz["ids"] = base_ids
2069 updated = True
2070
2071 return updated
2072
2073 @classmethod
2074 def add_schema_to_class(cls, class_name: str, filename: str, schemas: list[str], dry_run: bool) -> int:

Callers 1

indexMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected