def _base_ordering(base, degree):
 base_len = len(base)
 ordering = ([0] * degree)
 for i in range(base_len):
  ordering[base[i]] = i
 current = base_len
 for i in range(degree):
  if (i not in base):
   ordering[i] = current
   current += 1
 return ordering

def _base_ordering ( base , degree ) : base_len = len ( base ) ordering = ( [ 0 ] * degree ) for i in range ( base_len ) : ordering [ base [ i ] ] = i current = base_len for i in range ( degree ) : if ( i not in base ) : ordering [ i ] = current current += 1 return ordering
order {0 .