def _CreateCommentsFromPrefix(comment_prefix, comment_lineno, comment_column, standalone=False):
 comments = []
 lines = comment_prefix.split('\n')
 index = 0
 while (index < len(lines)):
  comment_block = []
  while ((index < len(lines)) and lines[index].lstrip().startswith('#')):
   comment_block.append(lines[index])
   index += 1
  if comment_block:
   new_lineno = ((comment_lineno + index) - 1)
   comment_block[0] = comment_block[0].lstrip()
   comment_block[(-1)] = comment_block[(-1)].rstrip('\n')
   comment_leaf = pytree.Leaf(type=token.COMMENT, value='\n'.join(comment_block), context=('', (new_lineno, comment_column)))
   comment_node = (comment_leaf if (not standalone) else pytree.Node(pygram.python_symbols.simple_stmt, [comment_leaf]))
   comments.append(comment_node)
  while ((index < len(lines)) and (not lines[index].lstrip())):
   index += 1
 return comments

def _CreateCommentsFromPrefix ( comment_prefix , comment_lineno , comment_column , standalone = False ) : comments = [ ] lines = comment_prefix . split ( '\n' ) index = 0 while ( index < len ( lines ) ) : comment_block = [ ] while ( ( index < len ( lines ) ) and lines [ index ] . lstrip ( ) . startswith ( '#' ) ) : comment_block . append ( lines [ index ] ) index += 1 if comment_block : new_lineno = ( ( comment_lineno + index ) - 1 ) comment_block [ 0 ] = comment_block [ 0 ] . lstrip ( ) comment_block [ ( - 1 ) ] = comment_block [ ( - 1 ) ] . rstrip ( '\n' ) comment_leaf = pytree . Leaf ( type = token . COMMENT , value = '\n' . join ( comment_block ) , context = ( '' , ( new_lineno , comment_column ) ) ) comment_node = ( comment_leaf if ( not standalone ) else pytree . Node ( pygram . python_symbols . simple_stmt , [ comment_leaf ] ) ) comments . append ( comment_node ) while ( ( index < len ( lines ) ) and ( not lines [ index ] . lstrip ( ) ) ) : index += 1 return comments
create pytree nodes to represent the given comment prefix .