code: def random_swap(t):
      (a, b) = t
      if random.randint(0, 1) == 1:
          return (a, b)
      else:
          return (b, a)
  
file_path: networkx/networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py
imports: import random
  import time
  import pytest
  import networkx
  from networkx.algorithms.isomorphism.tree_isomorphism import rooted_tree_isomorphism, tree_isomorphism
  from networkx.classes.function import is_directed
label_desc: Use image node_id 4 for calling a global function with example usage: random_swap(t) and returns: a,  b, b,  a