code: def test_index_select(dtype, device, is_undirected):
      kwargs = dict(
          dtype=dtype, device=device, is_undirected=is_undirected
      )
      adj = EdgeIndex(
          [[0, 1, 1, 2], [1, 0, 2, 1]], sort_order="row", **kwargs
      )
  
      index = tensor([1, 3], device=device)
      out = adj.index_select(1, index)
      assert out.equal(tensor([[1, 2], [0, 1]], device=device))
      assert isinstance(out, EdgeIndex)
      assert not out.is_sorted
      assert not out.is_undirected
  
      index = tensor([0], device=device)
      out = adj.index_select(0, index)
      assert out.equal(tensor([[0, 1, 1, 2]], device=device))
      assert not isinstance(out, EdgeIndex)
  
      index = tensor([1, 3], device=device)
      inplace = torch.empty(2, 2, dtype=dtype, device=device)
      out = torch.index_select(adj, 1, index, out=inplace)
      assert out.data_ptr() == inplace.data_ptr()
      assert isinstance(out, EdgeIndex)
      assert not isinstance(inplace, EdgeIndex)
  
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 16 for calling a global function with example usage: test_index_select(dtype, device, is_undirected) without return types