Skip to content

Instantly share code, notes, and snippets.

View Urmipie's full-sized avatar
:bowtie:
honk

Urmipie Urmipie

:bowtie:
honk
View GitHub Profile
@Urmipie
Urmipie / YandexGPT.py
Created April 14, 2024 13:28
Sending requests to yandexGPT. Yousing service tokens to generate IAM one and connect to API through IAM tokens
import credentials
from time import time
import jwt
import requests
class YandexGPT:
def __init__(self, service_account_id, key_id, private_key, folder_id, default_system_msg=None,
@Urmipie
Urmipie / levit.py
Last active March 28, 2024 20:04
Levit’s algorithm python3
from math import inf
def levit(graph, start):
min_weight = sum(sum(filter(lambda x: x < 0, row)) for row in graph) - 1
size = len(graph)
m0 = [] # checked
m1 = [start] # queue
m1_urg = [] # urgent queue
m2 = [i for i in range(size)] # unchecked