GitHub Action formats our code with psf/black (#1569)

* GitHub Action formats our code with psf/black

@poyea Your review please.

* fixup! Format Python code with psf/black push
This commit is contained in:
Christian Clauss
2019-11-14 19:59:43 +01:00
committed by GitHub
parent 52cf668617
commit 5df8aec66c
25 changed files with 523 additions and 400 deletions

View File

@@ -2,12 +2,13 @@ from abc import abstractmethod
import sys
from collections import deque
class LRUCache:
""" Page Replacement Algorithm, Least Recently Used (LRU) Caching."""
dq_store = object() # Cache store of keys
key_reference_map = object() # References of the keys in cache
_MAX_CAPACITY: int = 10 # Maximum capacity of cache
dq_store = object() # Cache store of keys
key_reference_map = object() # References of the keys in cache
_MAX_CAPACITY: int = 10 # Maximum capacity of cache
@abstractmethod
def __init__(self, n: int):
@@ -19,7 +20,7 @@ class LRUCache:
if not n:
LRUCache._MAX_CAPACITY = sys.maxsize
elif n < 0:
raise ValueError('n should be an integer greater than 0.')
raise ValueError("n should be an integer greater than 0.")
else:
LRUCache._MAX_CAPACITY = n
@@ -51,6 +52,7 @@ class LRUCache:
for k in self.dq_store:
print(k)
if __name__ == "__main__":
lru_cache = LRUCache(4)
lru_cache.refer(1)