def _RetainVerticalSpacingBetweenTokens(cur_tok, prev_tok):
 if (prev_tok is None):
  return
 if prev_tok.is_string:
  prev_lineno = (prev_tok.lineno + prev_tok.value.count(u'\n'))
 elif prev_tok.is_pseudo_paren:
  if (not prev_tok.previous_token.is_multiline_string):
   prev_lineno = prev_tok.previous_token.lineno
  else:
   prev_lineno = prev_tok.lineno
 else:
  prev_lineno = prev_tok.lineno
 if cur_tok.is_comment:
  cur_lineno = (cur_tok.lineno - cur_tok.value.count(u'\n'))
 else:
  cur_lineno = cur_tok.lineno
 cur_tok.AdjustNewlinesBefore((cur_lineno - prev_lineno))

def _RetainVerticalSpacingBetweenTokens ( cur_tok , prev_tok ) : if ( prev_tok is None ) : return if prev_tok . is_string : prev_lineno = ( prev_tok . lineno + prev_tok . value . count ( u'\n' ) ) elif prev_tok . is_pseudo_paren : if ( not prev_tok . previous_token . is_multiline_string ) : prev_lineno = prev_tok . previous_token . lineno else : prev_lineno = prev_tok . lineno else : prev_lineno = prev_tok . lineno if cur_tok . is_comment : cur_lineno = ( cur_tok . lineno - cur_tok . value . count ( u'\n' ) ) else : cur_lineno = cur_tok . lineno cur_tok . AdjustNewlinesBefore ( ( cur_lineno - prev_lineno ) )
retain vertical spacing between two tokens .