code: def test_validate():
      with pytest.raises(ValueError, match="unsupported data type"):
          EdgeIndex([[0.0, 1.0], [1.0, 0.0]])
      with pytest.raises(
          ValueError, match="needs to be two-dimensional"
      ):
          EdgeIndex([[[0], [1]], [[1], [0]]])
      with pytest.raises(ValueError, match="needs to have a shape of"):
          EdgeIndex([[0, 1], [1, 0], [1, 1]])
      with pytest.raises(
          ValueError, match="received a non-symmetric size"
      ):
          EdgeIndex(
              [[0, 1], [1, 0]], is_undirected=True, sparse_size=(2, 3)
          )
      with pytest.raises(
          TypeError, match="invalid combination of arguments"
      ):
          EdgeIndex(torch.tensor([[0, 1], [1, 0]]), torch.long)
      with pytest.raises(TypeError, match="invalid keyword arguments"):
          EdgeIndex(torch.tensor([[0, 1], [1, 0]]), dtype=torch.long)
      with pytest.raises(ValueError, match="contains negative indices"):
          EdgeIndex([[-1, 0], [0, 1]]).validate()
      with pytest.raises(ValueError, match="than its number of rows"):
          EdgeIndex([[0, 10], [1, 0]], sparse_size=(2, 2)).validate()
      with pytest.raises(
          ValueError, match="than its number of columns"
      ):
          EdgeIndex([[0, 1], [10, 0]], sparse_size=(2, 2)).validate()
      with pytest.raises(ValueError, match="not sorted by row indices"):
          EdgeIndex([[1, 0], [0, 1]], sort_order="row").validate()
      with pytest.raises(
          ValueError, match="not sorted by column indices"
      ):
          EdgeIndex([[0, 1], [1, 0]], sort_order="col").validate()
  
imports: import os.path
  import warnings
  from typing import List, Optional
  import pytest
  import torch
  from torch import Tensor, tensor
  import torch_geometric
  from torch_geometric import EdgeIndex
  from torch_geometric.edge_index import SUPPORTED_DTYPES, ReduceType, SortReturnType, _scatter_spmm, _torch_sparse_spmm, _TorchSPMM, set_tuple_item
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import onlyCUDA, onlyLinux, withCUDA, withoutExtensions, withPackage
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import scatter
label_desc: Use image node_id 5 for calling a global function with example usage: test_validate() without return types