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
"""Pickle dumps test. | |
When pickle dumps a class, it will include the FQDN for the module. In this example, | |
we see how an imported class gets dumped including its module information, whereas | |
a local one has the current module name, which could be `__main__` or other depending | |
on how the interpreter was called! | |
If you save this file as `pickle_deal.py` and then in a python terminal you import it | |
`import pickle_deal`, you will see the following printed: | |
b'\x80\x04\x95)\x00\x00\x00\x00\x00\x00\x00\x8c\x0bpickle_deal\x94\x8c\x07Decimal\x94\x93\x94\x8c\x07123.456\x94\x85\x94R\x94.' |
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 functools | |
from contextlib import asynccontextmanager, contextmanager | |
from time import monotonic | |
from typing import Annotated, Any, AsyncGenerator, Generator, Hashable, Iterable, Literal, Optional, Sized, Union, overload | |
from sqlalchemy import event | |
from sqlalchemy.dialects.mysql.asyncmy import AsyncAdapt_asyncmy_cursor | |
from sqlalchemy.engine import URL, Connection, Engine, Row, create_engine | |
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, async_sessionmaker, create_async_engine | |
from sqlalchemy.orm import Session, sessionmaker |
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
"""Handy cache helpers. | |
These are not yet production ready, as I haven't toroughly tested them, but close. | |
--- | |
Mandatory license blah blah: | |
Copyright (C) 2023 HacKan (https://hackan.net) | |
This Source Code Form is subject to the terms of the Mozilla Public |
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
"""Gunicorn config file. | |
by HacKan (https://hackan.net) | |
Find it at: https://gist.github.com/HacKanCuBa/275bfca09d614ee9370727f5f40dab9e | |
Based on: https://gist.github.com/KodeKracker/6bc6a3a35dcfbc36e2b7 | |
Changelog | |
========= | |
See revisions to access other versions of this file. |