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 random_nick(): | |
""" Сгенерировать ник (имя юзера). [Модификация: http://codepaste.ru/3853/]""" | |
vowels = 'aeuioy' | |
covowels = 'qwrtpsdfghjklzxcvbnm' | |
syllables = [[], []] | |
# Состовляем таблицу возможных | |
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
#-*-encoding:utf8-*- | |
import time | |
import httplib, urllib, re | |
class CaptchaError(Exception) : | |
""" Ошибка регистрации капч, в ответе anticaptha. """ | |
pass | |
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
function ajax_load_url(i, e) | |
{ | |
var currentPos = 0; | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', $(e).data('load-url'), true); | |
xhr.send(null); |
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
libraryDependencies += "org.ccil.cowan.tagsoup" % "tagsoup" % "1.2.1" |
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 authenticate(user: String, password: String) = { | |
/* Установить логин и пароль по умолчанию, необходимые для доступа к прокси. | |
Идея отсюда: http://blog.vinodsingh.com/2008/05/proxy-authentication-in-java.html*/ | |
import java.net.{Authenticator, PasswordAuthentication} | |
class ProxyAuthenticator(var user: String, var password: String) | |
extends Authenticator { | |
protected override def getPasswordAuthentication(): PasswordAuthentication = { |
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
from drf_spectacular.types import OpenApiTypes | |
from drf_spectacular.utils import extend_schema_field | |
@extend_schema_field(OpenApiTypes.INT) | |
class TimestampField(serializers.DateTimeField): | |
def to_internal_value(self, value): | |
try: | |
return datetime.fromtimestamp(int(value), tz=pytz.UTC) | |
except ValueError: | |
raise exceptions.ValidationError( |
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
{"timestamp":"2023-04-20T23:33:44.271499168Z","threadId":75,"namespace":"HydraNode-\"1\"","message":{"node":{"by":{"vkey":"b37aabd81024c043f53a069c91e51a5b52e4ea399ae17ee1fe3cb9c44db707eb"},"event":{"postChainTx":{"contestationDeadline":"2023-04-20T23:33:44Z","tag":"FanoutTx","utxo":{"8e8bf7795d7c3ed786758032085e14fe3127ffff302b519462984e0247d7f416#0":{"address":"addr_test1vq2tq3wvy82rzmm2ezt2gw9vr98ur9tnvxgcr34yff2qy9g8ny6m3","datum":null,"datumhash":null,"inlineDatum":null,"referenceScript":null,"value":{"lovelace":250000000}},"99cf7222af2f656b00240b61fe25d2aa6f9e09966d71754a522f123f72f4d80d#0":{"address":"addr_test1wzmgf6tetqh88fgxwj088v222wkcxkvgchngs60xuzx2g2grsaafx","datum":null,"inlineDatum":{"constructor":0,"fields":[{"constructor":0,"fields":[{"list":[]},{"constructor":0,"fields":[{"constructor":0,"fields":[{"bytes":"1052386136b347f3bb7c67fe3f2ee4ef120e1836e5d2707bb068afa6"},{"int":8000000000000}]}]}]},{"constructor":0,"fields":[{"bytes":"2035da628491aba52c1ab37ff68124d40fd49c0e5f258992229f0da7"}]}]} |
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
# --- LLM Configuration --- | |
OPENROUTER_API_KEY="XXX" | |
OPENROUTER_MODEL_NAME="deepseek/deepseek-r1" | |
# OPENROUTER_MODEL_NAME="google/gemini-2.5-pro-exp-03-25:free" | |
PROMPT= "You are a helpful assistant. Answer the user's question based on the provided context. If the context doesn't contain the answer, say you don't know based on the provided documents." | |
RAG_RETRIEVE_NUM=15 # Количество релевантных кусков из RAG добавляющихся в контекст на вопрос к LLM | |
# --- RAG Configuration --- | |
DEFAULT_DOCS_DIR="XXX" |