def _RetainVerticalSpacingBeforeComments(uwline):
 prev_token = None
 for tok in uwline.tokens:
  if (tok.is_comment and prev_token):
   if (((tok.lineno - tok.value.count(u'\n')) - prev_token.lineno) > 1):
    tok.AdjustNewlinesBefore(ONE_BLANK_LINE)
  prev_token = tok

def _RetainVerticalSpacingBeforeComments ( uwline ) : prev_token = None for tok in uwline . tokens : if ( tok . is_comment and prev_token ) : if ( ( ( tok . lineno - tok . value . count ( u'\n' ) ) - prev_token . lineno ) > 1 ) : tok . AdjustNewlinesBefore ( ONE_BLANK_LINE ) prev_token = tok
retain vertical spacing before comments .