I tried reading ultralytics python lib's function as below, but the vscode highlights with the error Type "dict[Unknown | Any, Unknown | Any | None] | Any" is not assignable to return type "dict[int, str]". I am sure the content I want to read is a dict[int, str] (The link is https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml#L18). But I am not sure how to correctly convert that unknown/ any/ none type to int and str types correctly. I appreciate any advice. Thanks.
def load_file() -> dict[int, str]:
path = check_yaml("coco.yaml")
return YAML.load(path) # this line is highlighted with Type "dict[Unknown | Any, Unknown | Any | None] | Any" is not assignable to return type "dict[int, str]"
data = load_file()
data.get("names)