def METHOD_NAME(tensor_pb: aiplatform_types.Tensor) -> Any:
    """Converts `Tensor` to a Python value.
    Args:
        tensor_pb: A `Tensor` object
    Returns:
        A corresponding Python object
    """
    list_of_fields = tensor_pb.ListFields()
    if not list_of_fields:
        return None
    descriptor, value = tensor_pb.ListFields()[0]
    if descriptor.name == "list_val":
        return [METHOD_NAME(x) for x in value]
    elif descriptor.name == "struct_val":
        return {k: METHOD_NAME(v) for k, v in value.items()}
    if not isinstance(value, Sequence):
        raise TypeError(f"Unexpected non-list tensor value {value}")
    if len(value) == 1:
        return value[0]
    else:
        return value