<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def scheduled_jobs(with_times=False, connection=None):
 """Gets all jobs in the scheduler. :param with_times: whether to return tuples with (job_id, timestamp) or just job_id as a list of strings. """

    if connection is None:
        connection = r
    jobs = connection.zrangebyscore(REDIS_KEY, 0, sys.maxsize,
                                    withscores=with_times)
    for job in jobs:
        if with_times:
            yield job[0].decode('utf-8'), job[1]
        else:
            yield job.decode('utf-8')