code: def _test_bidirected_graph():
      def _test(in_readonly, out_readonly):
          elist = [(0, 0), (0, 1), (1, 0), (1, 1), (2, 1), (2, 2)]
          num_edges = 7
          g = dgl.graph(elist)
          elist.append((1, 2))
          elist = set(elist)
          big = dgl.to_bidirected_stale(g, out_readonly)
          assert big.num_edges() == num_edges
          src, dst = big.edges()
          eset = set(zip(list(F.asnumpy(src)), list(F.asnumpy(dst))))
          assert eset == set(elist)
  
      _test(True, True)
      _test(True, False)
      _test(False, True)
      _test(False, False)
  
imports: import math
  import os
  import unittest
  import backend
  import dgl
  import dgl.function
  import dgl.partition
  import networkx
  import numpy
  import pytest
  from scipy import sparse
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases
label_desc: Use image node_id 12 for calling a global function with example usage: _test_bidirected_graph() without return types