def remove_decorator(source: str):
lines = source.splitlines()<EOL>atok = asttokens.ASTTokens(source, parse=True)<EOL>for node in ast.walk(atok.tree):<EOL><INDENT>if isinstance(node, ast.FunctionDef):<EOL><INDENT>break<EOL><DEDENT><DEDENT>if node.decorator_list:<EOL><INDENT>deco_first = node.decorator_list[<NUM_LIT:0>]<EOL>deco_last = node.decorator_list[-<NUM_LIT:1>]<EOL>line_first = atok.tokens[deco_first.first_token.index - <NUM_LIT:1>].start[<NUM_LIT:0>]<EOL>line_last = atok.tokens[deco_last.last_token.index + <NUM_LIT:1>].start[<NUM_LIT:0>]<EOL>lines = lines[:line_first - <NUM_LIT:1>] + lines[line_last:]<EOL><DEDENT>return "<STR_LIT:\n>".join(lines) + "<STR_LIT:\n>"<EOL>
Remove decorators from function definition