def parse_dataset_uri(uri: str) -> tuple[str, Optional[str]]:
    """
    Parse dataser uri to extract name and version out of it (if version is defined)
    Example:
        Input: ds://zalando@v3.0.1
        Output: (zalando, 3.0.1)
    """
    p = urlparse(uri)
    if p.scheme != "ds":
        raise Exception("Dataset uri should start with ds://")
    s = p.netloc.split("@v")
    name = s[0]
    if len(s) == 1:
        return name, None
    if len(s) != 2:
        raise Exception(
            "Wrong dataset uri format, it should be: ds://<name>@v<version>"
        )
    return name, s[1]

    Parse dataser uri to extract name and version out of it (if version is defined)
    Example:
        Input: ds://zalando@v3.0.1
        Output: (zalando, 3.0.1)
    
src/datachain/dataset.py