Utility function which checks if a line of text from a property file is a comment
Note: Private function
@function
@param   {string}  [line=""] A single line of text
@returns {boolean} If line is a comment returns true, otherwise false
16023
function (line) {
		line = line || "";
		line = line.trim();

		if (line.charAt(0) === "#") {
			return true;
		}

		return false;
	}
926538
public static String commentLine( String line ) {

		String result = line;
		if( ! Utils.isEmptyOrWhitespaces( line )
				&& ! line.trim().startsWith( ParsingConstants.COMMENT_DELIMITER ))
			result = ParsingConstants.COMMENT_DELIMITER + line;

		return result;
	}
761941
def _strip_comments(line):
        
        if line == '':
            return line
        r = re.search('(?P<line>[^#]*)(#(?P<comment>.*))?', line)
        if r:
            line = r.group('line')
            if not line.endswith('\n'):
                line += '\n'
            return line
        return '\n'
712393
function isComment (token) {
  return token != null && (token.type === 'Block' || token.type === 'Line' || token.type === 'Shebang' || token.type.endsWith('Comment'))
}
345941
private boolean commentLinesBefore( String content, int line )
  {
    int offset = _root.getElement( line ).getStartOffset();
    // Start of comment not found, nothing to do
    int startDelimiter = lastIndexOf( content, getStartDelimiter(), offset - 2 );
    if( startDelimiter < 0 )
    {
      return false;
    }
    // Matching start/end of comment found, nothing to do
    int endDelimiter = indexOf( content, getEndDelimiter(), startDelimiter );
    if( endDelimiter < offset & endDelimiter != -1 )
    {
      return false;
    }
    // End of comment not found, highlight the lines
    setCharacterAttributes( startDelimiter, offset - startDelimiter + 1, _comment, false );
    return true;
  }
1187977
def isBlockComment(self, line, column):
        
        return self._highlighter is not None and \
               self._highlighter.isBlockComment(self.document().findBlockByNumber(line), column)
480609
function isPaddingBetweenTokens(first, second) {
            const comments = sourceCode.getCommentsBefore(second);
            const len = comments.length;

            // If there is no comments
            if (len === 0) {
                const linesBetweenFstAndSnd = second.loc.start.line - first.loc.end.line - 1;

                return linesBetweenFstAndSnd >= 1;
            }


            // If there are comments
            let sumOfCommentLines = 0; // the numbers of lines of comments
            let prevCommentLineNum = -1; // line number of the end of the previous comment

            for (let i = 0; i < len; i++) {
                const commentLinesOfThisComment = comments[i].loc.end.line - comments[i].loc.start.line + 1;

                sumOfCommentLines += commentLinesOfThisComment;

                /*
                 * If this comment and the previous comment are in the same line,
                 * the count of comment lines is duplicated. So decrement sumOfCommentLines.
                 */
                if (prevCommentLineNum === comments[i].loc.start.line) {
                    sumOfCommentLines -= 1;
                }

                prevCommentLineNum = comments[i].loc.end.line;
            }

            /*
             * If the first block and the first comment are in the same line,
             * the count of comment lines is duplicated. So decrement sumOfCommentLines.
             */
            if (first.loc.end.line === comments[0].loc.start.line) {
                sumOfCommentLines -= 1;
            }

            /*
             * If the last comment and the second block are in the same line,
             * the count of comment lines is duplicated. So decrement sumOfCommentLines.
             */
            if (comments[len - 1].loc.end.line === second.loc.start.line) {
                sumOfCommentLines -= 1;
            }

            const linesBetweenFstAndSnd = second.loc.start.line - first.loc.end.line - 1;

            return linesBetweenFstAndSnd - sumOfCommentLines >= 1;
        }
1138379
function(comment){
    var ast = [];
    if (!comment.buffer) return;
    if (this.pp) push.apply(ast, this.prettyIndent(1, true));
    push.apply(ast, this.buffer('<!--' + comment.val + '-->'));
    return ast;
  }
739155
function lineComment(editor) {
        editor = editor || EditorManager.getFocusedEditor();
        if (!editor) {
            return;
        }

        editor.setSelections(editor.document.doMultipleEdits(_getLineCommentEdits(editor, editor.getSelections(), "line")));
    }
201464
def comment_lines(lines, prefix):
    """"""
    if not prefix:
        return lines
    return [prefix + ' ' + line if line else prefix for line in lines]
413538
private void commentLinesAfter( String content, int line )
  {
    int offset = _root.getElement( line ).getEndOffset();
    // End of comment not found, nothing to do
    int endDelimiter = indexOf( content, getEndDelimiter(), offset );
    if( endDelimiter < 0 )
    {
      return;
    }
    // Matching start/end of comment found, comment the lines
    int startDelimiter = lastIndexOf( content, getStartDelimiter(), endDelimiter );
    if( startDelimiter < 0 || startDelimiter <= offset )
    {
      setCharacterAttributes( offset, endDelimiter - offset + 1, _comment, false );
    }
  }
587716
function checkCommentLine(stack, fileext, line, lineN, cbs) {

        // custom comment format use config.extractCommentTagFromLine [

        function extractCommentTagFromLine(fileext, line) {
          line = line.trim();
          // CHECK FORMAT [
          var b;
          function chkfmt(b) {
            if (line.indexOf(b) == 0 && line.indexOf('[') == line.length-1) // begin
              return [line.substr(b.length, line.length-b.length-1).trim(), 0];
            if (line.indexOf(b) == 0 && line.indexOf(']') == line.length-1 && line.indexOf('[') == -1) // end
              return [line.substr(b.length, line.length-b.length-1).trim(), 1];
            return null;
          };
          // CHECK FORMAT ]

          // SUPPORT FORMATS [
          switch (fileext) {
            case '.js':
            case '.java':
            case '.c':
            case '.h':
            case '.cpp':
            case '.hpp':
            case '.less':
            case '.m':
            case '.mm':
              return chkfmt('//') || false;
            case '.css':
              return chkfmt('/*') || false;
            case '.acpul':
            case '.sh':
            case '.py':
            case '.pro':
              return chkfmt('#') || false;
            case '.ejs':
            case '.jade':
            case '.sass':
            case '.styl':
            case '.coffee':
              break;
            default:
              return null;
          }
          // SUPPORT FORMATS ]
          return false;
        }

        var tag = (config.extractCommentTagFromLine && config.extractCommentTagFromLine(fileext, line)) || extractCommentTagFromLine(fileext, line);
        if (tag === null)
          return false;

        // custom comment format use config.extractCommentTagFromLine ]

        if (tag) {
          // PROCESSING TAG [
          if (tag[1] == 0) {
            // ON BEGIN [
            var c = {name:tag[0], lines:[lineN, -1], parents:[]};
            stack.push(c);
            cbs.begin(stack, c);
            // ON BEGIN ]
          } else if (tag[1] == 1) {
            // ON END [
            if (stack.length > 0) {
              var ok = false;
              // dirty hack! [
              if (stack.slice(-1)[0].name == tag[0])
                ok = true;
              else if (stack.length > 1 && stack.slice(-2)[0].name == tag[0]) {
                var a = stack.slice(-2);
                var c = stack.pop();
                ok = true;
              } else
                cbs.error('Found close tag without match start tag'+tag[0]);
              // dirty hack! ]
              if (ok) {
                var c = stack.pop();
                c.lines[1] = lineN;
                //_.each(stack, function(p) {c.parents.push(p.name);});
                c.parents  = stack.slice(0);
                cbs.end(stack, c);
              }
            } else {
              cbs.error('Found close tag without any start tag '+tag[0]);
            }
            // ON END ]
          }
  //        console.log(filename);
  //        console.log(tag);
          // PROCESSING TAG ]
        }

        return true;
      }
316254
function checkComment(node) {
            if (isDirectiveComment(node) && selfConfigRegEx.test(node.value)) {
                return
            }

            const matches = commentContainsWarningTerm(node.value)

            for (const matchedTerm of matches) {
                context.report({
                    node,
                    messageId: "unexpected",
                    data: {
                        matchedTerm,
                    },
                })
            }
        }
591846
function checkComment(node) {
            if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) {
                return;
            }

            const matches = commentContainsWarningTerm(node.value);

            matches.forEach(matchedTerm => {
                context.report({
                    node,
                    message: "Unexpected '{{matchedTerm}}' comment.",
                    data: {
                        matchedTerm
                    }
                });
            });
        }
1142539
function getCommentLineNumbers(comments) {
            const lines = new Set();

            comments.forEach(comment => {
                for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) {
                    lines.add(i);
                }
            });

            return lines;
        }
1015948
function onComment(block, text, start, stop, startLoc, endLoc) {
      var match;
      commentsByEndLine[endLoc.line] = {
        text: text,
        block: block
      };
      match = text.match(/@module (\w+)/);
      if (match) {
        moduleName = match[1];
        modules.push({
          name: moduleName,
          comment: '/*' + text + '*/\n'
        });
      }
      // Both @module and @namespace may be defined in the same comment block.
      match = text.match(/@(namespace|module) \w+/g);
      if (match) {
        if (text.match(/@method/)) {
          // Don't allow temporary namespace renamings
          // in method block.
          return;
        }
        var namespace = match[match.length - 1].match(/@(namespace|module) (\w+)/)[2];
        namespaceBoundary(namespace, endLoc.line);
      }
    }
1369758
function hasNewlineBefore(node) {
            const lineNumNode = node.loc.start.line;
            const lineNumTokenBefore = getLineNumberOfTokenBefore(node);
            const commentLines = calcCommentLines(node, lineNumTokenBefore);

            return (lineNumNode - lineNumTokenBefore - commentLines) > 1;
        }