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 logging | |
from typing import TypeVar, Literal | |
from pydantic import BaseModel, root_validator | |
logger = logging.getLogger(__name__) | |
logging.basicConfig(level=logging.DEBUG) | |
class TestMarkup(BaseModel): |
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
[Shortcuts] | |
activate_last_tab=Alt+0 | |
activate_next_tab=Ctrl+PgDown; Ctrl+]; Ctrl+Tab | |
activate_prev_tab=Ctrl+PgUp; Ctrl+[; Ctrl+Shift+Tab | |
activate_tab_0=Alt+1 | |
activate_tab_1=Alt+2 | |
activate_tab_2=Alt+3 | |
activate_tab_3=Alt+4 | |
activate_tab_4=Alt+5 | |
activate_tab_5=Alt+6 |
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
# coding: utf-8 | |
import logging | |
class AddLoggerMeta(type): | |
def __new__(mcs, class_name, bases, attr_dict): | |
attr_dict[f'_{class_name}__logger'] = logging.getLogger(class_name) | |
return super().__new__(mcs, class_name, bases, attr_dict) |
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
# coding: utf-8 | |
import logging | |
__logger = logging.getLogger(__name__) | |
def global_function(): | |
__logger.error('global_function') |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
typedef unsigned char byte_t; | |
static const byte_t offset = 1; | |
static const byte_t limit = 4; |
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
# -*- coding: utf8 -*- | |
from __future__ import absolute_import, division, print_function | |
import logging | |
import sys | |
import requests | |
MIN_CHUNK_SIZE = 1.0 |
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
## РОДНОЕ ПРЕДСТАВЛЕНИЕ UTF8-СТРОКИ: | |
>>> [ord(i) for i in 'Бил Гейтс'] | |
[208, 145, 208, 184, 208, 187, | |
32, | |
208, 147, 208, 181, 208, 185, 209, 130, 209, 129] | |
# Что тут происходит: | |
# * Я перебираю все символы строки через цикл FOR. |
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 sys | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.model_selection import train_test_split,GridSearchCV, cross_val_score,StratifiedKFold,validation_curve,learning_curve | |
from sklearn.metrics import confusion_matrix, f1_score, matthews_corrcoef, precision_recall_curve, auc, classification_report, roc_curve, cohen_kappa_score, make_scorer,accuracy_score,roc_auc_score,precision_score,recall_score, brier_score_loss | |
from imblearn.ensemble import BalancedBaggingClassifier | |
from sklearn.tree import DecisionTreeClassifier | |
from xgboost.sklearn import XGBClassifier | |
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier |
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
[ | |
{ | |
"content_id": "87fc1328-cde3-40b0-9b9b-ced0498747c4", | |
"content_url": "https://h2.silatv.ru/highlight/12121/1080.mp4", | |
"thumbnail": "http://cdn.okultureno.ru/medialibrary/87f/87f2341b53596e8ca592a1e885261ccf/khokkey-_1_.jpg" | |
"type" : "game", | |
"channel": "telesport1", | |
"release_timestamp": 1518421201, // не нужно при наличие start_time & finish_time | |
"start_time": 1518421200, | |
"finish_time": 1518429600, |
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
# -*- coding: utf8 -*- | |
from __future__ import absolute_import, print_function | |
import six | |
class BaseFieldDao(object): | |
_value = None | |
_entity = None |
NewerOlder