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
# -*- coding: utf-8 -*- | |
import asyncio | |
from siokcp.asyncio import open_kcp_connection | |
async def cb(reader, writer: asyncio.StreamWriter): | |
data = await reader.read(10) | |
print(data) | |
writer.write(data) | |
await writer.drain() | |
writer.close() |
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
#!/usr/bin/env python3 | |
import asyncio | |
import hashlib | |
import json | |
from re import findall | |
from typing import Tuple | |
import httpx | |
from fastapi import Body, FastAPI | |
from fastapi.responses import JSONResponse |
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
""" | |
Copyright (c) 2008-2022 synodriver <[email protected]> | |
""" | |
import asyncio | |
from enum import IntEnum | |
from typing import List, Literal, Optional | |
class NotAvailable(Exception): | |
pass |
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
# -*- coding: utf-8 -*- | |
import os | |
if os.name == "nt": | |
import ctypes | |
from ctypes import wintypes | |
import msvcrt | |
INVALID_HANDLE_VALUE = -1 |
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 argparse | |
import hashlib | |
import os | |
import sys | |
from concurrent.futures import ThreadPoolExecutor | |
from typing import IO | |
def hash_filename(filename: str, chunk_size=2 * 10 * 6) -> str: | |
md = hashlib.md5() | |
with open(filename, "rb") as f: |
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
# | |
# This is a valgrind suppression file that should be used when using valgrind. | |
# | |
# Here's an example of running valgrind: | |
# | |
# cd python/dist/src | |
# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \ | |
# ./python -E ./Lib/test/regrtest.py -u gui,network | |
# | |
# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER |
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
""" | |
Copyright (c) 2008-2023 synodriver <[email protected]> | |
""" | |
import asyncio | |
import os | |
import sys | |
import threading | |
import time | |
from threading import Thread | |
from typing import Dict, Tuple |
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
""" | |
Copyright (c) 2008-2023 synodriver <[email protected]> | |
""" | |
import asyncio | |
import os | |
import pty | |
import sys | |
async def read_stdout(proc): |
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 re | |
from matplotlib import pyplot as plt | |
from PIL import Image,ImageColor, ImageDraw, ImageFont | |
import numpy as np | |
import zhconv | |
text = """A140 , 、 。 . ‧ ; : ? ! ︰ … ‥ ﹐ ﹑ ﹒ | |
A150 · ﹔ ﹕ ﹖ ﹗ | – ︱ — ︳ ╴ ︴ ﹏ ( ) ︵ | |
A160 ︶ { } ︷ ︸ 〔 〕 ︹ ︺ 【 】 ︻ ︼ 《 》 ︽ |
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
# 摸板抄你自己的 | |
template = """ | |
### | |
### This file contains configuration information for Abaqus/CAE | |
### language settings. | |
### | |
#################################################################### | |
# This section describes what language and what encoding Abaqus/CAE | |
# should use for a given system locale name. |
NewerOlder