# your code goes here
import re
input="""
def func1 options
    some code here
    def inner_func1 inner_options
        some code here
    end
    some more code here
end
"""
replacement="""
def new_func1 options
    new code here
end
"""
print(re.sub(r"(?:^|\n)([\t ]*?)def func1 options[\s\S]*?\n\1end",replacement,input),end='')