code: def test_bipartite_subgraph():
      edge_index = torch.tensor(
          [
              [0, 5, 2, 3, 3, 4, 4, 3, 5, 5, 6],
              [0, 0, 3, 2, 0, 0, 2, 1, 2, 3, 1],
          ]
      )
      edge_attr = torch.tensor(
          [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0]
      )
      idx = (torch.tensor([2, 3, 5]), torch.tensor([2, 3]))
      mask = (index_to_mask(idx[0], 7), index_to_mask(idx[1], 4))
      indices = (idx[0].tolist(), idx[1].tolist())
      mixed = (mask[0], idx[1])
  
      for subset in [idx, mask, indices, mixed]:
          out = bipartite_subgraph(
              subset, edge_index, edge_attr, return_edge_mask=True
          )
          assert out[0].tolist() == [[2, 3, 5, 5], [3, 2, 2, 3]]
          assert out[1].tolist() == [3.0, 4.0, 9.0, 10.0]
          assert out[2].tolist() == [0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0]
  
          out = bipartite_subgraph(
              subset, edge_index, edge_attr, relabel_nodes=True
          )
          assert out[0].tolist() == [[0, 1, 2, 2], [1, 0, 0, 1]]
          assert out[1].tolist() == [3.0, 4.0, 9.0, 10.0]
  
file_path: pytorch_geometric/test/utils/test_subgraph.py
imports: import torch
  from torch_geometric.nn import GCNConv, Linear
  from torch_geometric.testing import withCUDA, withPackage
  from torch_geometric.utils import bipartite_subgraph, get_num_hops, index_to_mask, k_hop_subgraph, subgraph
label_desc: Use image node_id 4 for calling a global function with example usage: test_bipartite_subgraph() without return types