ci: make ci happy lint the code, delete unused imports

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong0618
2023-05-24 18:42:55 +08:00
parent 562d5a98cc
commit b098a48898
75 changed files with 1110 additions and 824 deletions

View File

@@ -5,10 +5,12 @@
import abc
from typing import Any
class Singleton(abc.ABCMeta, type):
""" Singleton metaclass for ensuring only one instance of a class"""
"""Singleton metaclass for ensuring only one instance of a class"""
_instances = {}
def __call__(cls, *args: Any, **kwargs: Any) -> Any:
"""Call method for the singleton metaclass"""
if cls not in cls._instances:
@@ -18,4 +20,5 @@ class Singleton(abc.ABCMeta, type):
class AbstractSingleton(abc.ABC, metaclass=Singleton):
"""Abstract singleton class for ensuring only one instance of a class"""
pass
pass