<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate(input_path, output_path=None, in_memory=False, safe_mode=False, error_context=None):
 """Executes the Statik site generator using the given parameters. """

    project = StatikProject(input_path, safe_mode=safe_mode, error_context=error_context)
    return project.generate(output_path=output_path, in_memory=in_memory)