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
// Parse the response JSON | |
var response = pm.response.json(); | |
// Store the access token and token type in collection variables | |
pm.collectionVariables.set("auth_token", response.access_token); | |
pm.collectionVariables.set("auth_token_type", response.token_type); | |
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
{ | |
"version": "1.0.0", | |
"configurations": [ | |
{ | |
"name": "Python: Flask", | |
"type": "debugpy", | |
"request": "launch", | |
"module": "flask", | |
"env": { | |
"FLASK_APP": "main.py", |
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
{ | |
"version": "1.0.0", | |
"configurations": [ | |
{ | |
"name": "FASTAPI DEBUG", | |
"type": "debugpy", | |
"request": "launch", | |
"module": "fastapi", | |
"args": [ | |
"dev" |
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 contextlib import contextmanager | |
import mysql.connector | |
from mysql.connector.cursor_cext import CMySQLCursorDict | |
from mysql.connector.abstracts import MySQLConnectionAbstract | |
class LoggingCursor(CMySQLCursorDict): | |
def __init__(self, *args, **kwargs): | |
print(*args) | |
super(LoggingCursor, self).__init__(*args, **kwargs) |
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
export async function allObjectValuesAreTrue(obj) { | |
return ( | |
Object.values(obj).filter((v) => { | |
if (!(typeof v === 'boolean')) { | |
return !allObjectValuesAreTrue(v); | |
} | |
return !v; | |
}).length === 0 | |
); | |
} |
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 os | |
import json | |
from typing import Any, Literal | |
def create_folder_structure_json( | |
path: str, ignore: list[str] = [], ignore_files: bool = False | |
) -> dict[str, Any]: | |
""" | |
Recursively creates a dict representation of the folder structure starting from the given path. |
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, Any | |
from pydantic import BaseModel, field_validator, Field | |
import string | |
# the order of the list matters | |
WHERE_OPERATORS = [">=", "<=", "!=", "=", ">", "<", "LIKE", "NOT LIKE"] | |
class RequestParams(BaseModel): | |
""" | |
Represents the request parameters that client-side can use to filter/sort data. |
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 TypedDict, Any, NotRequired | |
import json | |
class RightTable(TypedDict): | |
name: str | |
label: NotRequired[str] | |
def extract_right_table_data( |