def _comment_directive(block, location):
 next_entry = (block[(location + 1)] if ((location + 1) < len(block)) else None)
 if (isinstance(next_entry, list) and next_entry):
  if ((len(next_entry) >= 2) and (next_entry[(-2)] == '#') and (COMMENT in next_entry[(-1)])):
   return
  elif isinstance(next_entry, nginxparser.UnspacedList):
   next_entry = next_entry.spaced[0]
  else:
   next_entry = next_entry[0]
 block.insert((location + 1), COMMENT_BLOCK[:])
 if ((next_entry is not None) and ('\n' not in next_entry)):
  block.insert((location + 2), '\n')

def _comment_directive ( block , location ) : next_entry = ( block [ ( location + 1 ) ] if ( ( location + 1 ) < len ( block ) ) else None ) if ( isinstance ( next_entry , list ) and next_entry ) : if ( ( len ( next_entry ) >= 2 ) and ( next_entry [ ( - 2 ) ] == '#' ) and ( COMMENT in next_entry [ ( - 1 ) ] ) ) : return elif isinstance ( next_entry , nginxparser . UnspacedList ) : next_entry = next_entry . spaced [ 0 ] else : next_entry = next_entry [ 0 ] block . insert ( ( location + 1 ) , COMMENT_BLOCK [ : ] ) if ( ( next_entry is not None ) and ( '\n' not in next_entry ) ) : block . insert ( ( location + 2 ) , '\n' )
add a comment to the end of the line at location .