This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from abc import ABC, abstractmethod, ABCMeta | |
from dataclasses import dataclass, field | |
from typing import ( | |
Any, | |
Callable, | |
Dict, | |
List, | |
Optional, | |
Sequence, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
import inspect | |
from typing import Any, Dict, Optional, Sequence, Callable | |
class PrePostHooks: | |
"""A class that lets you register pre and post hooks onto a method of a class. | |
You can create a function and then register the function. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass, field | |
from enum import Enum | |
from typing import Dict, Sequence, Union | |
# Import queues module | |
from queues import Queue | |
from queues import Stack | |
from queues import PriorityQueue | |
from queues import Event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import time | |
from datetime import datetime | |
# API Requests | |
import requests | |
# Async Requests | |
import aiohttp | |
from asyncio import ensure_future, gather | |
import asyncio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from dataclasses import dataclass | |
from typing import Any, Dict, List, Optional | |
@dataclass | |
class HierarchicalAttributes: | |
name: str | |
parent: Optional[HierarchicalAttributes] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass, field | |
from enum import Enum | |
from typing import Dict, Set | |
# Import pub_sub module | |
from pub_sub import PubSub | |
from pub_sub import Subscriber | |
from pub_sub import ReceiveMessageStrategies | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import threading | |
import html | |
class NoSQLDatabase: | |
def __init__(self, file_name): | |
self.file_name = file_name | |
self.lock = threading.Lock() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC, abstractmethod | |
from dataclasses import dataclass, field | |
from enum import Enum | |
from typing import List, Optional, Union | |
from ssl import create_default_context | |
from ssl import SSLContext | |
from email import message_from_bytes | |
from email import parser | |
import smtplib | |
import poplib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aiohttp | |
from asyncio import ensure_future, gather | |
import asyncio | |
async def request_worker(session: aiohttp.ClientSession, **kwargs): | |
async with session.request(**kwargs) as response: | |
return await response.json() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from io import StringIO | |
from typing import Dict | |
from dataclasses import dataclass | |
from enum import Enum | |
import logging | |
from logging.handlers import RotatingFileHandler | |
try: |
OlderNewer