class_docstr: Least-Recently-Used cache.
  Acts as a wrapper around an arbitrary function and caches the return values.
  
  Based on the implementation of Raymond Hettinger
  (https://stackoverflow.com/questions/2437617/limiting-the-size-of-a-python-dictionary)
  
  Parameters
  ----------
  original_function: callable
      The original function that will be wrapped. Return values will be cached.
      The function parameters have to be hashable.
  max_size: int (optional, default 10_000)
      The maximum number of elements allowed within the cache. If the size would be exceeded,
      the least recently used element will be removed from the cache.
code: def __init__(self, original_function, max_size=10000):
      self.original_function = original_function
      self.max_size = max_size
      self.mapping = {}
  
      # oldest
      self.head = [None, None, None, None]
      # newest
      self.tail = [self.head, None, None, None]
      self.head[_NEXT] = self.tail
  
file_path: pgmpy/pgmpy/estimators/ScoreCache.py
imports: from pgmpy.estimators import StructureScore
label_desc: Use image node_id 1 to create a new LRUCache object  with example: obj = LRUCache(original_function, max_size)