code: def __init__(
      self,
      width=640,
      height=480,
      x_offset=0,
      y_offset=0,
      fps=30,
      pipeline_string=None,
      buffer_seconds=5,
  ):
      self.width = width
      self.height = height
  
      self.x_offset = x_offset
      self.y_offset = y_offset
  
      self.frame_time = 1 / fps
      self.frame_buffer_size = buffer_seconds * fps
  
      self.redis_client = redis_client
      self.screen_grabber = mss.mss()
  
      self.frame_transformation_pipeline = None
  
      if pipeline_string is not None and isinstance(
          pipeline_string, str
      ):
          self.frame_transformation_pipeline = (
              FrameTransformationPipeline(
                  pipeline_string=pipeline_string
              )
          )
  
      # Clear any previously stored frames
      self.redis_client.delete(config["frame_grabber"]["redis_key"])
      self.redis_client.delete(
          config["frame_grabber"]["redis_key"] + "_PIPELINE"
      )
  
file_path: SerpentAI/serpent/frame_grabber.py
imports: import numpy
  import mss
  from redis import StrictRedis
  from serpent.config import config
  import time
  from serpent.game_frame import GameFrame
  from serpent.game_frame_buffer import GameFrameBuffer
  from serpent.frame_transformation_pipeline import FrameTransformationPipeline
label_desc: Use image node_id 1 to create a new FrameGrabber object  with example: obj = FrameGrabber(width, height, x_offset, y_offset, fps, pipeline_string, buffer_seconds)