def _partition(seq, vector, m=None):
 if (m is None):
  m = (max(vector) + 1)
 elif (type(vector) is int):
  (vector, m) = (m, vector)
 p = [[] for i in range(m)]
 for (i, v) in enumerate(vector):
  p[v].append(seq[i])
 return p

def _partition ( seq , vector , m = None ) : if ( m is None ) : m = ( max ( vector ) + 1 ) elif ( type ( vector ) is int ) : ( vector , m ) = ( m , vector ) p = [ [ ] for i in range ( m ) ] for ( i , v ) in enumerate ( vector ) : p [ v ] . append ( seq [ i ] ) return p
partition the list in the list items before and after the sel .