parameters: (self, comment, comment_prefix='// ',
                wrap_indent=0, new_line=True)
return_statement: return self
docstring: Adds the given string as a comment.
  
      Will split the comment if it's too long. Use mainly for variable length
      comments. Otherwise just use code.Append('// ...') for comments.
  
      Unaffected by code.Substitute().
docstring_summary: Adds the given string as a comment.
docstring_tokens: Adds the given string as a comment .
function: def Comment(self, comment, comment_prefix='// ',
                wrap_indent=0, new_line=True):
      """Adds the given string as a comment.
  
      Will split the comment if it's too long. Use mainly for variable length
      comments. Otherwise just use code.Append('// ...') for comments.
  
      Unaffected by code.Substitute().
      """
      # Helper function to trim a comment to the maximum length, and return one
      # line and the remainder of the comment.
      def trim_comment(comment, max_len):
        if len(comment) <= max_len:
          return comment, ''
        last_space = comment.rfind(' ', 0, max_len + 1)
        if last_space != -1:
          line = comment[0:last_space]
          comment = comment[last_space + 1:]
        else:
          line = comment[0:max_len]
          comment = comment[max_len:]
        return line, comment.lstrip()
  
      # First line has the full maximum length.
      if not new_line and self._code:
        max_len = self._comment_length - len(self._code[-1].value)
      else:
        max_len = (self._comment_length - len(''.join(self._line_prefixes)) -
                   len(comment_prefix))
      line, comment = trim_comment(comment, max_len)
      self.Append(comment_prefix + line, substitute=False, new_line=new_line)
  
      # Any subsequent lines be subject to the wrap indent.
      max_len = (self._comment_length - len(''.join(self._line_prefixes)) -
                 len(comment_prefix) - wrap_indent)
      while len(comment):
        line, comment = trim_comment(comment, max_len)
        self.Append(comment_prefix + (' ' * wrap_indent) + line, substitute=False)
  
      return self
function_tokens: def Comment ( self , comment , comment_prefix = '// ' , wrap_indent = 0 , new_line = True ) : # Helper function to trim a comment to the maximum length, and return one # line and the remainder of the comment. def trim_comment ( comment , max_len ) : if len ( comment ) <= max_len : return comment , '' last_space = comment . rfind ( ' ' , 0 , max_len + 1 ) if last_space != - 1 : line = comment [ 0 : last_space ] comment = comment [ last_space + 1 : ] else : line = comment [ 0 : max_len ] comment = comment [ max_len : ] return line , comment . lstrip ( ) # First line has the full maximum length. if not new_line and self . _code : max_len = self . _comment_length - len ( self . _code [ - 1 ] . value ) else : max_len = ( self . _comment_length - len ( '' . join ( self . _line_prefixes ) ) - len ( comment_prefix ) ) line , comment = trim_comment ( comment , max_len ) self . Append ( comment_prefix + line , substitute = False , new_line = new_line ) # Any subsequent lines be subject to the wrap indent. max_len = ( self . _comment_length - len ( '' . join ( self . _line_prefixes ) ) - len ( comment_prefix ) - wrap_indent ) while len ( comment ) : line , comment = trim_comment ( comment , max_len ) self . Append ( comment_prefix + ( ' ' * wrap_indent ) + line , substitute = False ) return self