def untokenize_without_newlines(tokens):
 text = u''
 last_row = 0
 last_column = (-1)
 for t in tokens:
  token_string = t[1]
  (start_row, start_column) = t[2]
  (end_row, end_column) = t[3]
  if (start_row > last_row):
   last_column = 0
  if (((start_column > last_column) or (token_string == u'\n')) and (not text.endswith(u' '))):
   text += u' '
  if (token_string != u'\n'):
   text += token_string
  last_row = end_row
  last_column = end_column
 return text.rstrip()

def untokenize_without_newlines ( tokens ) : text = u'' last_row = 0 last_column = ( - 1 ) for t in tokens : token_string = t [ 1 ] ( start_row , start_column ) = t [ 2 ] ( end_row , end_column ) = t [ 3 ] if ( start_row > last_row ) : last_column = 0 if ( ( ( start_column > last_column ) or ( token_string == u'\n' ) ) and ( not text . endswith ( u' ' ) ) ) : text += u' ' if ( token_string != u'\n' ) : text += token_string last_row = end_row last_column = end_column return text . rstrip ( )
return source code based on tokens .