def _trace_S(s, j, b, S_cosets):
    for h in S_cosets[b]:
        if s[h[b]] == j:
            return h
    return None
Return the representative h satisfying s[h[b]] == j
dataset/ETHPy150Open sympy/sympy/sympy/combinatorics/tensor_can.py/_trace_S