Spaces:
Sleeping
Sleeping
Download singleton.py from Wajahat698/agent: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/spaces/Wajahat698/agent/resolve/main/singleton.py
- Command line
-
hf download hf://spaces/Wajahat698/agent/singleton.py
-
curl -L -o singleton.py https://huggingface.co/spaces/Wajahat698/agent/resolve/main/singleton.py
504 Bytes
| class Singleton: | |
| _instance = None | |
| _is_initialized = False | |
| def __new__(cls, *args, **kwargs): | |
| if cls._instance is None: | |
| cls._instance = super(Singleton, cls).__new__(cls) | |
| return cls._instance | |
| def __init__(self, value=None): | |
| if not self._is_initialized: | |
| self.projectCode = value | |
| self._is_initialized = True | |
| def set_code(self, value): | |
| self.projectCode = value | |
| def get_code(self): | |
| return self.projectCode |