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 os | |
import openai | |
import asyncio | |
import gradio as gr | |
MODEL = "gpt-3.5-turbo-instruct" | |
if "OPENAI_PROXY" in os.environ: | |
openai.proxy = os.environ["OPENAI_PROXY"] | |
openai.api_key = os.environ["OPENAI_API_KEY"] |
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
! | |
! _ooOoo_ | |
! o8888888o | |
! 88" . "88 | |
! (| -_- |) | |
! O\ = /O | |
! ____/`---'\____ | |
! .' \\| |// `. | |
! / \\||| : |||// \ | |
! / _||||| -:- |||||- \ |
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 ast | |
import inspect | |
import types | |
class Apply(ast.NodeTransformer): | |
def __init__(self): | |
super().__init__() | |
self._never_function = True |
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
from nonebot.adapters import Event, Message | |
from nonebot.params import EventPlainText, CommandArg | |
from nonebot.plugin.on import on_message, on_command | |
from nonebot.adapters.onebot.v11.message import MessageSegment | |
import os | |
import ast | |
import json | |
import shelve | |
import aiohttp |
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 | |
import fire | |
import openai | |
import os | |
import prompt_toolkit | |
import tiktoken | |
# Authenticate with OpenAI API | |
assert "OPENAI_API_KEY" in os.environ, "OPENAI_API_KEY environment variable not set." | |
openai.api_key = os.environ["OPENAI_API_KEY"] |
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 TAT | |
Tensor = TAT.No.D.Tensor | |
L1 = 2 | |
L2 = 4 | |
D = 5 | |
def construct_tensor(l1, l2): |
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
<div id=container /> | |
<script> | |
async function getList() { | |
const resp = await fetch("list.txt", {cache: "no-store"}) | |
const text = await resp.text() | |
const list = text.split("\n") | |
return list.filter(name => name.includes(".png")) | |
} | |
var container = document.getElementById("container") | |
var oldList = [] |
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 <random> | |
#include <type_traits> | |
#include <variant> | |
template <class T> struct replace_void { using type = T; }; | |
template <> struct replace_void<void> { using type = std::monostate; }; | |
template <class T> using replace_void_t = typename replace_void<T>::type; | |
template <class... Fn> struct overloaded : Fn... { |
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 metaA(type): | |
def __new__(cls, n, b, a): | |
#a["__add__"] = lambda x,y:4 | |
obj = type.__new__(cls, n, b, a) | |
#obj.__add__ = lambda x,y:4 | |
return obj | |
def __getattr__(self, name): | |
if name == "__add__": | |
return lambda x,y:4 | |
raise AttributeError() |
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 <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
typedef int (*SIN)(int); | |
typedef int (*DOU)(int,int); | |
int proto(int b){ | |
DOU fun=(DOU)'+'; |
NewerOlder