code: def test_flip(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
      )
      adj.fill_cache_()
  
      out = adj.flip(0)
      assert isinstance(out, EdgeIndex)
      assert out.equal(
          tensor([[1, 0, 2, 1], [0, 1, 1, 2]], device=device)
      )
      assert out.is_sorted_by_col
      assert out.is_undirected == is_undirected
      assert out._T_indptr.equal(tensor([0, 1, 3, 4], device=device))
  
      out = adj.flip([0, 1])
      assert isinstance(out, EdgeIndex)
      assert out.equal(
          tensor([[1, 2, 0, 1], [2, 1, 1, 0]], device=device)
      )
      assert not out.is_sorted
      assert out.is_undirected == is_undirected
      assert out._T_indptr is None
  
      adj = EdgeIndex(
          [[1, 0, 2, 1], [0, 1, 1, 2]], sort_order="col", **kwargs
      )
      out = adj.flip(0)
      assert isinstance(out, EdgeIndex)
      assert out.equal(
          tensor([[0, 1, 1, 2], [1, 0, 2, 1]], device=device)
      )
      assert out.is_sorted_by_row
      assert out.is_undirected == is_undirected
  
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 15 for calling a global function with example usage: test_flip(dtype, device, is_undirected) without return types