HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/black/schema.py
import importlib.resources
import json
import sys
from typing import Any


def get_schema(tool_name: str = "black") -> Any:
    """Get the stored complete schema for black's settings."""
    assert tool_name == "black", "Only black is supported."

    pkg = "black.resources"
    fname = "black.schema.json"

    if sys.version_info < (3, 9):
        with importlib.resources.open_text(pkg, fname, encoding="utf-8") as f:
            return json.load(f)

    schema = importlib.resources.files(pkg).joinpath(fname)  # type: ignore[unreachable]
    with schema.open(encoding="utf-8") as f:
        return json.load(f)