<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_scheduler(db_uri):
 """Initialise and configure the scheduler."""

    global scheduler
    scheduler = apscheduler.Scheduler()
    scheduler.misfire_grace_time = 3600
    scheduler.add_jobstore(
        sqlalchemy_store.SQLAlchemyJobStore(url=db_uri), 'default')
    scheduler.add_listener(
        job_listener,
        events.EVENT_JOB_EXECUTED | events.EVENT_JOB_MISSED
        | events.EVENT_JOB_ERROR)
    return scheduler