code: def transversal2coset(size, base, transversal):
      a = []
      j = 0
      for i in range(size):
          if i in base:
              a.append(sorted(transversal[j].values()))
              j += 1
          else:
              a.append([list(range(size))])
      j = len(a) - 1
      while a[j] == [list(range(size))]:
          j -= 1
      return a[: j + 1]
  
imports: from sympy.combinatorics.permutations import Permutation, _af_rmul, _af_invert, _af_new
  from sympy.combinatorics.perm_groups import PermutationGroup, _orbit, _orbit_transversal
  from sympy.combinatorics.util import _distribute_gens_by_base, _orbits_transversals_from_bsgs
label_desc: Use image node_id 6 for calling a global function with example usage: transversal2coset(size, base, transversal) and returns: a