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
def remove_keys_copy_on_write(obj, keys_to_delete): | |
""" | |
Recursively removes specified keys from a nested data structure (dicts and lists) using a | |
copy-on-write strategy. This means that only the parts of the structure containing the keys to be removed | |
are copied and modified, while the rest remains as references to the original objects. | |
Parameters: | |
- obj: The input nested data structure (can be a dict, list, or other types). | |
- keys_to_delete: A collection (set or list) of keys to be removed from dictionaries at any nesting level. |
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 fastapi import FastAPI, Request, Response | |
from functools import wraps | |
import json | |
app = FastAPI() | |
logger = logging.getLogger("my_logger") | |
def log_route(level: str = "info", log_body: bool = False): | |
def decorator(func): |
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
Сумма_средних_длительностей_по_этапам = | |
VAR Этапы = | |
SUMMARIZE( | |
FILTER( | |
'этапы перевозки', | |
RELATED('перевозки'[продукт]) = SELECTEDVALUE('продукты'[id]) | |
), | |
'этапы перевозки'[номер этапа], | |
"СредняяДлительность", | |
AVERAGEX( |
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 tkinter as tk | |
from tkinter import ttk, messagebox, filedialog | |
import csv | |
from datetime import datetime | |
import os | |
import pandas as pd | |
class Task: | |
def __init__(self, name, archived=False): | |
self.name = name |
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
DECLARE | |
v_count NUMBER; | |
BEGIN | |
FOR col IN (SELECT column_name FROM all_tab_columns WHERE table_name = 'WETAB') LOOP | |
EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM wetab WHERE ' || col.column_name || ' = 5000001' | |
INTO v_count; | |
IF v_count > 0 THEN | |
DBMS_OUTPUT.PUT_LINE('Значение найдено в столбце: ' || col.column_name); | |
END IF; | |
END LOOP; |
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 | |
import math | |
import cv2 | |
from rtmlib import Wholebody, draw_skeleton, BodyWithFeet, Body | |
from rtmlib.visualization import halpe26 | |
log = logging.getLogger(__name__) | |