def is_wsl(v: str = platform.uname().release) -> int:
    """Detects if Python is running in WSL"""

    if v.endswith("-Microsoft"):
        return 1
    elif v.endswith("microsoft-standard-WSL2"):
        return 2

    return 0
Detects if Python is running in WSL
python/dgl/graphbolt/internal_utils.py