code: def lru_cache_df(maxsize, typed=False):
      """Least-recently-used cache decorator for pandas Dataframes.
  
      Decorator to wrap a function with a memoizing callable that saves up to the maxsize most recent calls. It can
      save time when an expensive or I/O bound function is periodically called with the same arguments.
  
      Inspired in the `lru_cache function <https://docs.python.org/3/library/functools.html#functools.lru_cache>`_.
  
      Args:
          maxsize (int|None): max size of cache, if set to None cache is boundless
          typed (bool): arguments of different types are cached separately
      """
  
      def to_pandas_hash(val):
          """Return PandaHash object if input is a DataFrame otherwise return input unchanged"""
          return (
              PandasHash(val) if isinstance(val, pd.DataFrame) else val
          )
  
      def from_pandas_hash(val):
          """Extract DataFrame if input is PandaHash object otherwise return input unchanged"""
          return (
              val.pandas_object if isinstance(val, PandasHash) else val
          )
  
      def decorating_function(user_function):
          @wraps(user_function)
          def wrapper(*args, **kwargs):
              # convert DataFrames in args and kwargs to PandaHash objects
              args = tuple([to_pandas_hash(a) for a in args])
              kwargs = {k: to_pandas_hash(v) for k, v in kwargs.items()}
              return cached_wrapper(*args, **kwargs)
  
          @lru_cache(maxsize=maxsize, typed=typed)
          def cached_wrapper(*args, **kwargs):
              # get DataFrames from PandaHash objects in args and kwargs
              args = tuple([from_pandas_hash(a) for a in args])
              kwargs = {
                  k: from_pandas_hash(v) for k, v in kwargs.items()
              }
              return user_function(*args, **kwargs)
  
          # retain lru_cache attributes
          wrapper.cache_info = cached_wrapper.cache_info
          wrapper.cache_clear = cached_wrapper.cache_clear
  
          return wrapper
  
      return decorating_function
  
imports: import logging
  import pandas
  import numpy
  from functools import lru_cache, wraps
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_LABEL_COL
label_desc: Use image node_id 6 for calling a global function with example usage: lru_cache_df(maxsize, typed) and returns: decorating_function, unknown, unknown, wrapper, cached_wrapper, user_function