def _workaround_func_lineno(self, node):
<EOL>if node.decorator_list:<EOL><INDENT>linex = node.lineno - <NUM_LIT:1><EOL>pattern = r'<STR_LIT>' + node.name<EOL>while not re.match(pattern, self.sourcelines[linex]):<EOL><INDENT>linex += <NUM_LIT:1><EOL><DEDENT>lineno = linex + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>lineno = node.lineno<EOL><DEDENT>return lineno<EOL>
Example:
    >>> source = utils.codeblock(
        '''
        @bar
        @baz
        def foo():
            'docstr'
        ''')
    >>> self = TopLevelVisitor(source)
    >>> node = self.syntax_tree().body[0]
    >>> self._workaround_func_lineno(node)
    3