def add_line_numbers(self, s, css_class):
        result = ''
        start = 0
        end = s.find('\n')+1
        while end:
            result += s[start:end-1]
            if css_class: result += '</tt>'
            result += ' </tt>' # py-line
            result += '\n'
            if self.ADD_LINE_NUMBERS:
                result += self.lineno_to_html()
            result += '  <tt class="py-line">'
            if css_class: result += '<tt class="%s">' % css_class
            start = end
            end = s.find('\n', end)+1
            self.lineno += 1
        result += s[start:]
        return result
dataset/ETHPy150Open QuantSoftware/QuantSoftwareToolkit/Legacy/epydoc-3.0.1/epydoc/docwriter/html_colorize.py/PythonSourceColorizer.add_line_numbers/original