code: def test_perm_af_direct_product():
      gens1 = [[1, 0, 2, 3], [0, 1, 3, 2]]
      gens2 = [[1, 0]]
      assert perm_af_direct_product(gens1, gens2, 0) == [
          [1, 0, 2, 3, 4, 5],
          [0, 1, 3, 2, 4, 5],
          [0, 1, 2, 3, 5, 4],
      ]
      gens1 = [[1, 0, 2, 3, 5, 4], [0, 1, 3, 2, 4, 5]]
      gens2 = [[1, 0, 2, 3]]
      assert [
          [1, 0, 2, 3, 4, 5, 7, 6],
          [0, 1, 3, 2, 4, 5, 6, 7],
          [0, 1, 2, 3, 5, 4, 6, 7],
      ]
  
file_path: sympy/sympy/combinatorics/tests/test_tensor_can.py
imports: from sympy.combinatorics.permutations import Permutation, Perm
  from sympy.combinatorics.tensor_can import perm_af_direct_product, dummy_sgs, riemann_bsgs, get_symmetric_group_sgs, canonicalize, bsgs_direct_product
  from sympy.combinatorics.testutil import canonicalize_naive, graph_certificate
  from sympy.testing.pytest import skip, XFAIL
label_desc: Use image node_id 1 for calling a global function with example usage: test_perm_af_direct_product() without return types