This file contains hidden or 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
| # NOTE: Generated based off the verison that was written before the first release of the New Multidict C-API | |
| # Sources may differ as updates keep getting produced. | |
| from cpython.object cimport ( | |
| PyObject as PyObject, | |
| PyTypeObject as PyTypeObject | |
| ) | |
| from libc.stdint cimport uint64_t as uint64_t | |
| cdef extern from "multidict_capi_struct.h": |
This file contains hidden or 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
| cimport cython | |
| from cpython.exc cimport PyErr_SetObject | |
| from cpython.contextvars cimport PyContext_CopyCurrent | |
| from asyncio import get_event_loop, format_helpers, CancelledError, InvalidStateError | |
| import sys | |
| from cpython.list cimport PyList_GET_SIZE | |
| # Concept work for winloop & uvloop speedups in theory. | |
| cdef extern from "Python.h": |
This file contains hidden or 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
| # Contains a collection of pyatomic functions that have been exclusively modified for the use with | |
| # C Compiled sources for the sake of speed and needing less costly functionality | |
| # or having to deal with the annoying headaches of adding these in yourself. | |
| from libc.stdint cimport * | |
| cdef extern from "cyatomics.h" nogil: | |
| int _cyatomic_add_int(int *obj, int value) | |
| int8_t _cyatomic_add_int8(int8_t *obj, int8_t value) | |
| int16_t _cyatomic_add_int16(int16_t *obj, int16_t value) |
This file contains hidden or 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
| /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to | |
| * deal in the Software without restriction, including without limitation the | |
| * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
| * sell copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: | |
| * | |
| * The above copyright notice and this permission notice shall be included in |
This file contains hidden or 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
| # here's how we could use our custom module we made to eliminate some slowness with other things. | |
| # example show is aiohttp/_http_writer.pyx with a few upgrades but also our own module being injected on in. | |
| from cpython.bytes cimport PyBytes_FromStringAndSize | |
| from cpython.exc cimport PyErr_NoMemory, PyErr_SetString, PyErr_SetObject | |
| from cpython.mem cimport PyMem_Free, PyMem_Malloc, PyMem_Realloc | |
| from cpython.object cimport PyObject_Str | |
| from libc.stdint cimport uint8_t, uint64_t | |
| from libc.string cimport memcpy |
This file contains hidden or 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
| """A External Module for the deprecation of subclassing a class | |
| this will be a seperate library soon if demand is seen for it.""" | |
| import functools | |
| import warnings | |
| from collections.abc import Sequence | |
| from types import MethodType | |
| from typing import TypeVar | |
| # Modeled after deprecated-params but for the deprecation of subclassing |
This file contains hidden or 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
| # Small mini fixer for pre-commit yaml to play nicely with windows since windows has it's own quirks unlike linux. | |
| # This repairs and fixes the probelm. | |
| import sys | |
| import pathlib | |
| if __name__ == "__main__": | |
| if ("--help" in sys.argv) or ("-h" in sys.argv): | |
| print(" fix_yaml.py <FILE>\n") | |
| print(" FILE A yaml file that needs fixing") | |
| print(" --help, -h Prints help and exits") |
This file contains hidden or 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
| """A Small and compact scheduler built off anyio and reedited around python-std shed""" | |
| from __future__ import annotations | |
| import inspect | |
| import sys | |
| from collections import deque | |
| from datetime import datetime, timedelta | |
| from itertools import count | |
| from typing import ( |
This file contains hidden or 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
| """A Small and compact scheduler built off asyncio and reedited around python-std sched""" | |
| from __future__ import annotations | |
| import asyncio | |
| import heapq | |
| import inspect | |
| import types | |
| from itertools import count | |
| from typing import ( |
This file contains hidden or 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
| /* This CPython Writer is a mirror of the aiohttp & Yarl source code for implementing | |
| a fast and easy to use writer that could be implemented & Used in Cython and | |
| CPython projects. This was an idea for the transition of the current _http_writer | |
| cython module in aiohttp on over to C When or if we decide to go down that route with | |
| header serlization with Http/1.1 , | |
| This also has new tools that could be used for http/2 Frame writing | |
| so this library also implements tools that the struct module would use but for writing | |
| in special bytes. |
NewerOlder