def METHOD_NAME(v):
    """Convert a Scipp Variable to a python dict."""
    out = {
        "dims": _dims_to_strings(v.dims),
        "shape": v.shape,
        "unit": v.unit,
        "dtype": v.dtype,
    }
    if not v.aligned:
        out["aligned"] = False
    # Use defaultdict to return the raw values/variances by default
    dtype_parser = defaultdict(lambda: lambda x, y: x)
    # Using raw dtypes as dict keys doesn't appear to work, so we need to
    # convert to strings.
    dtype_parser.update(
        {
            str(DType.vector3): _vec_parser,
            str(DType.linear_transform3): _vec_parser,
            str(DType.string): _vec_parser,
        }
    )
    str_dtype = str(v.dtype)
    # Check if variable is 0D:
    suffix = "s" if len(out["dims"]) > 0 else ""
    out["values"] = dtype_parser[str_dtype](getattr(v, "value" + suffix), v.shape)
    var = getattr(v, "variance" + suffix)
    out["variances"] = (
        dtype_parser[str_dtype](var, v.shape) if var is not None else None
    )
    return out