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
import asyncio | |
def static_hi(this): | |
"""this function is not asynchronous""" | |
return this | |
async def printer(): | |
"""notice arguments are not passed directly""" |
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
"D:\Hry\steamcmd\steamcmd.exe" +login anonymous +app_update 1110390 +exit | |
start "" "%~dp0ServerHelper.bat" +InternetServer/Ostrava |
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 numpy.random import seed | |
from numpy.random import normal | |
import matplotlib.pyplot as plt | |
def get_ndist_list(loc=0, scale=1, size=100): | |
return list(normal(loc=loc, scale=scale, size=size)) | |
def define_x_axis(y_axis): | |
x_axis = [] |
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
import time | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import scipy.stats as stats | |
import math | |
import cairo | |
class TexasRanger: |
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
# | |
# Test of experimental Tornado feature for a streaming request body handler, see | |
# https://github.com/nephics/tornado/commit/1bd964488926aac9ef6b52170d5bec76b36df8a6 | |
# | |
# | |
# Client sending file to server | |
# | |
import tornado.httpclient as httpclient |
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
import random | |
import requests | |
import re | |
def fetch(max_length=12, min_length=6): | |
title = None | |
while not title or min_length < len(title) > max_length: | |
url = "https://en.wikipedia.org/wiki/Special:Random" | |
mashup = requests.get(url).text |
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
target_list = [{"ip": 1, "ad": 0}, {"ip": 2, "ad": 0}] | |
s2 = {"ip": 2} | |
s3 = {"ip": 3} | |
if s2["ip"] not in [x["ip"] for x in target_list]: | |
print(f"{s2['ip']} is new") | |
if s3["ip"] not in [x["ip"] for x in target_list]: | |
print(f"{s2['ip']} is new") |
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
import signal | |
import time | |
import readchar | |
def handler(signum, frame): | |
msg = "Ctrl-c was pressed. Do you really want to exit? y/n " | |
print(msg, end="", flush=True) | |
res = readchar.readchar() | |
if res == 'y': | |
print("") |
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
import random | |
a = [3, 3, 3, 3, 3, 3] | |
b = [6, 5, 2, 2, 2, 2] | |
c = [4, 4, 4, 4, 1, 1] | |
a_wins = 0 | |
b_wins = 0 | |
c_wins = 0 |
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 cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey, Ed25519PublicKey | |
from cryptography.hazmat.primitives import serialization | |
def unhex(hexed): | |
return b''.fromhex(hexed) | |
def sign(private_key, message): | |
private_bytes = unhex(private_key) | |
private_key_raw = Ed25519PrivateKey.generate().from_private_bytes(private_bytes) | |
signature = private_key_raw.sign(message.encode()).hex() |