code: def _set_lock_scheduler(
      redis_lock: redis.lock.Lock, redis_params: RedisParams
  ) -> BackgroundScheduler:
      scheduler = BackgroundScheduler()
      extend_lock = functools.partial(
          _extend_lock,
          redis_lock=redis_lock,
          redis_timeout=redis_params.redis_timeout,
      )
      scheduler.add_job(
          extend_lock,
          "interval",
          seconds=redis_params.lock_extend_seconds,
          max_instances=999999999,
          misfire_grace_time=redis_params.redis_timeout,
          coalesce=False,
      )
      scheduler.start()
      return scheduler
  
imports: import functools
  import os
  from logging import getLogger
  from typing import Callable, NamedTuple, Optional
  import redis
  from apscheduler.schedulers.background import BackgroundScheduler
label_desc: Use image node_id 3 for calling a global function with example usage: _set_lock_scheduler(redis_lock, redis_params) and returns: scheduler