class_docstr: This updates both Redis and an in-memory cache simultaneously.
  When data is updated or inserted, it is written to both the in-memory cache + Redis.
  This ensures that even if Redis hasn't been updated yet, the in-memory cache reflects the most recent data.
code: def get_cache(self, key, local_only: bool = False, **kwargs):
      # Try to fetch from in-memory cache first
      try:
          print_verbose(
              f"get cache: cache key: {key}; local_only: {local_only}"
          )
          result = None
          if self.in_memory_cache is not None:
              in_memory_result = self.in_memory_cache.get_cache(
                  key, **kwargs
              )
  
              print_verbose(f"in_memory_result: {in_memory_result}")
              if in_memory_result is not None:
                  result = in_memory_result
  
          if (
              result is None
              and self.redis_cache is not None
              and local_only == False
          ):
              # If not found in in-memory cache, try fetching from Redis
              redis_result = self.redis_cache.get_cache(key, **kwargs)
  
              if redis_result is not None:
                  # Update in-memory cache with the value from Redis
                  self.in_memory_cache.set_cache(
                      key, redis_result, **kwargs
                  )
  
              result = redis_result
  
          print_verbose(f"get cache: cache result: {result}")
          return result
      except Exception as e:
          traceback.print_exc()
  
imports: import litellm
  import time, logging
  import json, traceback, ast, hashlib
  from typing import Optional, Literal, List, Union, Any
  from openai._models import BaseModel
label_desc: Use image node_id 3 for calling the DualCache obj's underlying member method code with example usage: obj.get_cache(key, local_only) and returns: result