def _clean_order(order):
 order = re.findall('\\([0-9 ]*?\\)', order)
 clean = (lambda x: tuple(map(int, re.sub('[()]', '', x).split(' '))))
 if (len(order) > 1):
  (order, sorder) = map(clean, order)
 else:
  order = clean(order[0])
  sorder = (0, 0, 0)
 return (order, sorder)

def _clean_order ( order ) : order = re . findall ( '\\([0-9 ]*?\\)' , order ) clean = ( lambda x : tuple ( map ( int , re . sub ( '[()]' , '' , x ) . split ( ' ' ) ) ) ) if ( len ( order ) > 1 ) : ( order , sorder ) = map ( clean , order ) else : order = clean ( order [ 0 ] ) sorder = ( 0 , 0 , 0 ) return ( order , sorder )
takes something like and returns a arma order .