def test(self, current_modified_line, file_lines=None, index=None):
        """
        This is line a Setext header with an AnchorHub tag specified? Return
        True if it is.

        file_lines and index _must_ be provided to this function, or it will
        throw a ValueError

        :param current_modified_line: string representing the the line at
            file_lines[index] _after_ any previous modifications from other
            WriterStrategy objects
        :param file_lines: List of strings corresponding to lines in a text file
        :param index: index of file_lines corresponding to the current line:
        :return: True if current_modified_line is a Setext header with an
        AnchorHub tag declared. False otherwise
        """
        if file_lines is None:
            raise ValueError("file_lines list must be provided to test() method"
                             " in MarkdownSetextWriterStrategy")
        if index is None:
            raise ValueError("index must be provided to test() method in "
                             "MarkdownSetextWriterStrategy")

        # If index is at len(file_lines) - 1, it's the last line in file
        # Since it needs an underline, cannot be a header
        index_in_bounds = index < len(file_lines) - 1

        if (self._header_regex.search(current_modified_line) and
                self._underline_regex.match(file_lines[index+1]) and
                index_in_bounds):
            return True
        else:
            return False
def test ( self , current_modified_line , file_lines = None , index = None ) : if file_lines is None : raise ValueError ( "file_lines list must be provided to test() method" " in MarkdownSetextWriterStrategy" ) if index is None : raise ValueError ( "index must be provided to test() method in " "MarkdownSetextWriterStrategy" ) index_in_bounds = index < len ( file_lines ) - 1 if ( self . _header_regex . search ( current_modified_line ) and self . _underline_regex . match ( file_lines [ index + 1 ] ) and index_in_bounds ) : return True else : return False
This is line a Setext header with an AnchorHub tag specified? Return
        True if it is.

        file_lines and index _must_ be provided to this function, or it will
        throw a ValueError

        :param current_modified_line: string representing the the line at
            file_lines[index] _after_ any previous modifications from other
            WriterStrategy objects
        :param file_lines: List of strings corresponding to lines in a text file
        :param index: index of file_lines corresponding to the current line:
        :return: True if current_modified_line is a Setext header with an
        AnchorHub tag declared. False otherwise