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
""" | |
Adds async context to a Python logger. | |
""" | |
import asyncio | |
import functools | |
import inspect | |
import logging | |
from contextvars import ContextVar | |
from typing import Any, Callable |
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 asyncio | |
from nekoton import JrpcTransport, Address, PublicKey, Cell | |
def get_rpc(blockchain) -> JrpcTransport: | |
rpc = { | |
1: "https://jrpc.everwallet.net/rpc", | |
2: "https://jrpc-testnet.venom.foundation/rpc", | |
}[blockchain] |
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 base64 | |
import copy | |
import json | |
import logging | |
import uuid | |
from decimal import Decimal | |
from django.conf import settings | |
from django.http import HttpRequest | |
from django.utils.encoding import force_bytes |
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
class Database1: | |
def get_connection(self, host, port, db, user='', password=''): | |
pass | |
def execute(self, conn, sql, params, unescaped=None): | |
pass | |
class MysqlDatabase(Database1): |
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
class User: | |
def __init__(self, login=None, password=None, first_name=None, last_name=None, phone=None): | |
self.login = login | |
self.password = password | |
self.first_name = first_name | |
self.last_name = last_name | |
self.phone = phone | |
class Hotel: |
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
class A(object): pass | |
a = A() | |
a.x = 1 | |
setattr(a, 'y', 2) | |
a.__dict__ # {'y': 2, 'x': 1} | |
a.__setattr__('z', 3) | |
a.__dict__ # {'y': 2, 'x': 1, 'z': 3} |
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 <iostream> | |
#include <list> | |
#include <map> | |
#include <string> | |
using namespace std; | |
class Node { | |
public: | |
char Symbol; | |
int Frequency; | |
Node *Right, *Left; |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using std::cout; | |
using std::cin; | |
class Group{ | |
public: | |
Group(){ |
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 <vector> | |
#include <iostream> | |
using namespace std; | |
class Matrix{ | |
public: | |
Matrix(int n) { | |
matrix.resize(n*(n+1)/2, 0); | |
size = n; | |
} |
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 <string> | |
#include <iostream> | |
using namespace std; | |
int main(){ | |
long long last[10],next[10],i,n,h,ans; | |
cin>>n; |
NewerOlder