Processes line stripping any comments from it

        :param line: line to be processed
        :type line: str
        :return: line with removed comments
        :rtype: str
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'
1355916
def comment_filter(comment_text):
    
    filter_func = settings.COMMENT_FILTER
    if not filter_func:
        def filter_func(s):
            return linebreaksbr(urlize(s, autoescape=True), autoescape=True)
    elif not callable(filter_func):
        filter_func = import_dotted_path(filter_func)
    return filter_func(comment_text)
494098
def strip_line(line)
      file_format.line_definitions.any? { |_name, definition| definition =~ line } ? line : ''
    end
158179
def process(self, line):
        ''''''
        self.raw = self.raw + line
        try:
            if not line[-1] == self.eol_char:
                # Should always be here, but add it just in case.
                line = line + self.eol_char
        except IndexError:
            # Thrown if line == ''
            line = self.eol_char
                
        for char in line:
            if char == self.escape_char:
                # Always handle escaped characters.
                self.last_process_char = self.process_char
                self.process_char = self.process_escape
                continue
            self.process_char(char)
        if not self.complete:
            # Ask for more.
            self.process( self.handler.readline(prompt=self.handler.CONTINUE_PROMPT) )
699638
def handle_comment(self, comment):
        

        match = _COND_COMMENT_PATTERN.match(comment)
        if match is not None:
            cond = match.group(1)
            content = match.group(2)

            self._buffer.append(_COND_COMMENT_START_FORMAT % cond)
            self._push_status()
            self.feed(content)
            self._pop_status()
            self._buffer.append(_COND_COMMENT_END_FORMAT)
        elif not self.remove_comments:
            self._buffer.append(_COMMENT_FORMAT % comment)
823349
def __extract_description(self):
        
        tmp = list()
        for line in self._comment:
            if len(line) >= 1 and line[0] == '@':
                break

            tmp.append(line)

        tmp = self.__remove_trailing_empty_lines(tmp)

        self._description = os.linesep.join(tmp)
244913
def uncomment_line(line, prefix):
    """"""
    if not prefix:
        return line
    if line.startswith(prefix + ' '):
        return line[len(prefix) + 1:]
    if line.startswith(prefix):
        return line[len(prefix):]
    return line
1162594
def _process_line(self, line):
        
        fields = self._extract_fields(line)
        if not self._fields_valid(fields):
            self.log.warning("Missing required fields for line: {line}".format(
                line=line))

        metric_path_base = []
        graphite_prefix = fields.get('GRAPHITEPREFIX')
        graphite_postfix = fields.get('GRAPHITEPOSTFIX')

        if graphite_prefix:
            metric_path_base.append(graphite_prefix)

        hostname = fields['HOSTNAME'].lower()
        metric_path_base.append(hostname)

        datatype = fields['DATATYPE']
        if datatype == 'HOSTPERFDATA':
            metric_path_base.append('host')
        elif datatype == 'SERVICEPERFDATA':
            service_desc = fields.get('SERVICEDESC')
            graphite_postfix = fields.get('GRAPHITEPOSTFIX')
            if graphite_postfix:
                metric_path_base.append(graphite_postfix)
            else:
                metric_path_base.append(service_desc)

        perfdata = fields[datatype]
        counters = self._parse_perfdata(perfdata)

        for (counter, value) in counters:
            metric_path = metric_path_base + [counter]
            metric_path = [self._sanitize(x) for x in metric_path]
            metric_name = '.'.join(metric_path)
            self.publish(metric_name, value)
201464
def comment_lines(lines, prefix):
    """"""
    if not prefix:
        return lines
    return [prefix + ' ' + line if line else prefix for line in lines]
972484
def remove_line_with(cls, lines, what):
        
        result = []
        for line in lines:
            if what not in line:
                result = result + [line]
        return result
958900
def _end_comment_type_from_line(line):
    
    regex = re.compile(r"^{0}".format(_FTR_COMMENT))
    match = regex.match(line)
    if match:
        return " */"

    return ""
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;
	}
1145061
def strip_units_from_lines(lines):
    
    for line in lines:
        for unit in ALL_UNITS:
            if line.endswith(" %s" % unit):
                line = line[:-1-len(unit)]
        yield line
630538
def process_line(line) # :nodoc:
      file_tasks, args = line.split(":", 2)
      return if args.nil?
      dependents = args.split.map { |d| respace(d) }
      file_tasks.scan(/\S+/) do |file_task|
        file_task = respace(file_task)
        file file_task => dependents
      end
    end
24802
function removeComments(line) {
	var commentStartIndex = line.indexOf('#');
	if (commentStartIndex > -1) {
		return line.substr(0, commentStartIndex);
	}

	return line;
}
1002374
def get_lines_without_comments(filename: str) -> List[str]:
    
    lines = []
    with open(filename) as f:
        for line in f:
            line = line.partition('#')[0]  # the part before the first #
            line = line.rstrip()
            line = line.lstrip()
            if line:
                lines.append(line)
    return lines
1011386
def comment_out_line(filename, line, comment='#',
                     update_or_append_line=update_or_append_line):
    '''
    '''
    update_or_append_line(filename, prefix=line, new_line=comment+line,
                          append=False)