<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fail_run_group(group, session):
 """ End the run_group unsuccessfully. Args: group: The run_group we want to complete. session: The database transaction we will finish. """

    from datetime import datetime

    group.end = datetime.now()
    group.status = 'failed'
    session.commit()