def _trace_S(s, j, b, S_cosets):
 for h in S_cosets[b]:
  if (s[h[b]] == j):
   return h
 return None

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 if there is not such a representative return none .