@invoke.task()<EOL>def profile(ctx, filepath, calltree=False):
filepath = pathlib.Path(filepath)<EOL>if not filepath.is_file():<EOL><INDENT>report.error(ctx, "<STR_LIT>", f"<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if calltree:<EOL><INDENT>report.info(ctx, "<STR_LIT>", f"<STR_LIT>")<EOL>ctx.run(<EOL>(<EOL>f"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>report.info(ctx, "<STR_LIT>", f"<STR_LIT>")<EOL>ctx.run(f"<STR_LIT>")<EOL><DEDENT><DEDENT>
Run and profile a given Python script.

    :param str filepath: The filepath of the script to profile