def _trace_D(gj, p_i, Dxtrav):
 for h in Dxtrav:
  if (h[gj] == p_i):
   return h
 return None

def _trace_D ( gj , p_i , Dxtrav ) : for h in Dxtrav : if ( h [ gj ] == p_i ) : return h return None
return the representative h satisfying h[gj] == p_i if there is not such a representative return none .