def METHOD_NAME(optstring: str) -> "dict[str, Any]":
    """Converts comma-separated ``"key":value`` options string `optstring`
    to a keyword dict and returns it.
    The values should be valid Python expressions. They are parsed with
    ast.literal_eval().
    Parameters:
        optstring: Commma-separated options string.
    Returns:
        Parsed options as a dictionary.
    """
    try:
        return ast.literal_eval("{%s}" % (optstring,))
    except Exception as exc:
        raise ValueError(
            f"invalid in option string ({exc.__name__}): {optstring!r}"
        ) from exc