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
from dataclasses import dataclass | |
from typing import Any, TypedDict | |
from adaptix import Retort, CannotProvide, name_mapping, loader, Chain | |
from adaptix._internal.provider.loc_stack_filtering import LocStack, P | |
from adaptix._internal.provider.location import TypeHintLoc | |
from adaptix._internal.provider.shape_provider import InputShapeRequest | |
class ClassTOTD: |
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
from dataclasses import dataclass | |
from pathlib import Path | |
import grpc | |
from google._upb._message import FieldDescriptor | |
from adaptix import TypeHint | |
from adaptix._internal.conversion.facade.func import get_converter | |
from adaptix._internal.model_tools.definitions import ( | |
InputShape, InputField, NoDefault, Param, ParamKind, OutputShape, |
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
import importlib | |
import os | |
from typing import Iterator | |
import alembic.command | |
import alembic.config | |
import psycopg | |
import pytest | |
import pytest_asyncio | |
from sqlalchemy import NullPool |
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
class JwtIdProvider(IdentityProvider): | |
def __init__(self, jwk_uri: str, aud: str, context: ServicerContext) -> None: | |
self.jwks_client = PyJWKClient(jwk_uri) | |
self.aud = aud | |
self.context = context | |
async def get_user(self) -> User | None: | |
for header, value in self.context.invocation_metadata(): | |
if header != "authorization": | |
continue |
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
class A: | |
def foo(self): | |
print("foo") |
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
from collections.abc import AsyncIterator, Iterator | |
from contextlib import contextmanager | |
from typing import TypeVar | |
from dishka import ( | |
DEFAULT_COMPONENT, | |
AsyncContainer, | |
Container, | |
make_async_container, | |
make_container, |
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
# logic | |
MOD x = y | |
x = MOD.__transform__(t"{y}") # lazy evaluation | |
x = MOD(y) # general case | |
# unpack | |
MOD1 x, MOD2 y = z | |
_x, _y = z | |
x = MOD1(x), MOD2(y) |
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
import asyncio | |
import logging | |
import os | |
from dataclasses import dataclass | |
from typing import Any | |
from aiogram import Bot, Dispatcher, Router, F | |
from aiogram.filters import CommandStart | |
from aiogram.fsm.state import State | |
from aiogram.types import Message, CallbackQuery |
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
import http | |
import json | |
import logging | |
from dataclasses import dataclass | |
from datetime import datetime | |
from typing import Any | |
import aiohttp | |
from adaptix import Retort |
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
from enum import auto | |
from dishka import BaseScope | |
try: | |
from dishka.entities.scope import new_scope | |
except ImportError: | |
new_scope = str | |
class B: | |
def __init__(self, x: int): |
NewerOlder