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 typing as t | |
import pytest | |
from pydantic import BaseModel | |
from pydantic.json_schema import GenerateJsonSchema | |
from fastapi import FastAPI | |
from fastapi._compat import get_definitions | |
from fastapi.openapi.constants import REF_TEMPLATE | |
from fastapi.openapi.utils import get_fields_from_routes |
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
<TaskOptions> | |
<TaskOptions> | |
<option name="arguments" value="$FilePath$" /> | |
<option name="checkSyntaxErrors" value="true" /> | |
<option name="description" /> | |
<option name="exitCodeBehavior" value="ERROR" /> | |
<option name="fileExtension" value="py" /> | |
<option name="immediateSync" value="false" /> | |
<option name="name" value="Format code using black" /> | |
<option name="output" value="$FilePath$" /> |
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 random | |
from time import sleep | |
import httpx | |
class TaskRepository: | |
def get_all(self): |
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 pytest | |
BASE = 10 | |
SYMBOLS_DICT = {1: "I", 5: "V", 10: "X", 50: "L", 100: "C", 500: "D", 1000: "M"} | |
def get_digit_at(num, pos): | |
return num // 10 ** pos % 10 | |
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 typing import Generic, TypeVar | |
import uvicorn | |
from fastapi import FastAPI | |
from pydantic import BaseModel | |
from pydantic.generics import GenericModel | |
T = TypeVar("T") | |
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 pathlib import Path | |
class GunicornConfigBuilder: | |
def __init__(self): | |
self._cmd = "gunicorn" | |
self._log_level = None | |
self._app_module = "tests.integration.webserver.app:app" | |
self._check_only = False | |
self._print_only = False |
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
{"categories": { | |
"Pflicht": { | |
"Miete": 500.00, | |
"Krankenversicherung": 0.00, | |
"Lebensmittel": 0.00 | |
}, | |
"Projekte": { | |
"Notfall": 2000 | |
}, | |
"Realität": { |
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
#!/usr/bin/env python | |
# vim: set fileencoding=utf8 : | |
"""Singleton Mixin""" | |
class Singleton(object): | |
"""Singleton Mixin Class | |
Inherit this class and make the subclass Singleton. | |
Usage: |
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
# source: https://stackoverflow.com/a/28507806 | |
def mocked_requests_get(*args, **kwargs): | |
class MockResponse: | |
def __init__(self, json_data, status_code): | |
self.json_data = json_data | |
self.status_code = status_code | |
def json(self): | |
return self.json_data |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import ConfigParser | |
import argparse | |
import os | |
import logging | |
import sys | |
import gitlab | |
import threading |
NewerOlder