Skip to content

Instantly share code, notes, and snippets.

@ahvahsky2008
ahvahsky2008 / server.py
Last active October 19, 2023 19:45
YandexGPT - эмуляция браузера
import json
import re
import aiohttp
from uuid import uuid4
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
{
"doc_info": [
{
"doc_type": "TORG_12",
"pages": [
{
"page_id": "911f6780-3003-4d59-8fe0-e18e7463328a",
"page_orient": 0,
"page_num": 1,
"page_ml": "1",
from datetime import date, datetime
import uuid
from dataclasses import dataclass, field
datatables_list = {
'film_work': FilmWork,
'person': Person,
'person_film_work': PersonFilmWork,
'genre': Genre,
'genre_film_work': GenreFilmWork,
}
for base, schema in datatables_list.items():
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
class Node:
def __init__(self, name: str, parent: 'Node' = None):
self.name = name
self.parent = parent
self.children = []
def add_child(self, obj: 'Node'):
self.children.append(obj)
@property
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
@ahvahsky2008
ahvahsky2008 / python send file with requests
Created March 26, 2021 12:36
python send file with requests
def send_request (doc):
with open(doc, 'rb') as file:
post_data = {'chat_id': chat_id}
post_file = {'document': file}
r = requests.post(f'https://api.telegram.org/bot{token}/sendDocument', data=post_data, files=post_file)
print(r.text)
public class Post
{
[XmlRpcMember("post_id")]
public string Id { get; set; }
[XmlRpcMember("post_type")]
public string PostType { get; set; }
[XmlRpcMember("post_title")]
public string Title { get; set; }
version: '2'
services:
web:
image: odoo:12.0
depends_on:
- mydb
ports:
- "8069:8069"
environment:
- HOST=mydb