#NEWLINE# def get_method_document_block( self , method_name , contents ) : #NEWLINE# #INDENT# start_method_document = ( '  .. py:method:: %s(' % method_name ) #NEWLINE# start_index = contents . find ( start_method_document ) #NEWLINE# self . assertNotEqual ( start_index , ( - 1 ) , 'Method is not found in contents' ) #NEWLINE# contents = contents [ start_index : ] #NEWLINE# end_index = contents . find ( '  .. py:method::' , len ( start_method_document ) ) #NEWLINE# return contents [ : end_index ]