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 threading import Thread | |
| from time import sleep | |
| from queue import Queue | |
| from flask import Flask | |
| import requests | |
| from pyngrok import ngrok | |
| app = Flask(__name__) | |
| q = Queue() |
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 fastapi import FastAPI, Form, UploadFile, File, Depends | |
| from pydantic import BaseModel | |
| app = FastAPI() | |
| class FormSerializer(BaseModel): | |
| logo: UploadFile | |
| name: str |
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 logging | |
| from typing import Optional, Sequence, Union | |
| from pydantic import BaseModel, validator, ValidationError | |
| from pydantic.error_wrappers import ErrorWrapper | |
| class Child(BaseModel): | |
| id: int | |
| name: str |
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 typing import Optional, Type | |
| import warnings | |
| from pydantic import BaseModel | |
| from pydantic.main import ModelMetaclass | |
| class SerializerMetaclass(ModelMetaclass): | |
| def __new__(self, name, bases, namespaces, **kwargs): | |
| annotations = namespaces.get("__annotations__", {}) |