What data structure would you use to implement a LRU cache? Implement the cache operations using a hash map and doubly linked list so that get and put each run in O(1) time. The function receives a positive capacity and operations represented as ['get', key] or ['put', key, value], and returns the values produced by get, using -1 for missing keys.
def lru_cache_operations(capacity, operations):