source
stringlengths
3
86
python
stringlengths
75
1.04M
Bitcoin_randomCPU.py
''' Made by Mizogg Look for Bitcoin Compressed and Uncompressed 3 bc1 Using iceland2k14 secp256k1 https://github.com/iceland2k14/secp256k1 fastest Python Libary Good Luck and Happy Hunting Bitcoin_randomCPU.py Version 2 scan randomly in Range with CPU Speed Improvments https://mizogg.co.uk ''' import secp2...
helpers.py
""" Helper functions file for OCS QE """ import base64 import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time from concurrent.futures import ThreadPoolExecutor from subprocess import PIPE, TimeoutExpired, run from uuid import uuid4 i...
mysql.py
#导入pymysql的包 import pymysql import threading def demo(conn): try: cur=conn.cursor()#获取一个游标 cur.execute('select id from 10 ORDER BY RAND() LIMIT 1000') data=cur.fetchall() print(len(data)) # cur.close()#关闭游标 # conn.close()#释放数据库资源 except Exception :print("查询失败")...
otu_table_pairwise.py
import numpy as np import util as utl import threading import time def otu_pairwise(path, datakind): dataset = path rootdir = '/media/banua/Data/Kuliah/Destiny/Tesis/Program/csipb-jamu-prj.20160613.fixed/similarity-func/data/' data = np.loadtxt(rootdir+dataset, delimiter=",") data = data[:, ...
benchmark_2d.py
# Copyright 2021 Google LLC # # 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 writing, ...
core_test.py
# Copyright 2017 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...
server-ddb.py
from math import floor from world import World import Queue import SocketServer import datetime import random import re import requests import sqlite3 import sys import threading import time import traceback import boto3 from botocore.exceptions import ClientError dynamodb_client = boto3.client("dynamodb", region_nam...
test_run_and_rebot.py
import unittest import time import glob import sys import threading import tempfile import signal import logging from os.path import abspath, curdir, dirname, exists, join from os import chdir, getenv from robot import run, run_cli, rebot, rebot_cli from robot.model import SuiteVisitor from robot.running import namesp...
test_explain_loader.py
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
multiprocessing_1.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import multiprocessing def my_worker(): print("Currently Executing Child Process") print("This process has it's own instance of the GIL") print("Executing Main Process") print("Creating Child Process") def main(): my_process = multiprocessing.Proces...
server.py
import socketserver as ss import threading from socket import socket from typing import Dict from .ReqHandler import ReqHandler class Server(ss.ThreadingTCPServer, ss.TCPServer): """ my socket server """ PORT = 20307 ADDR = '0.0.0.0' running: bool = True clients: Dict[str, ReqHandler] = {} usernames: Dict[st...
prediction.py
import datetime import json import os import threading import time from queue import Queue from optimization.forecastPublisher import ForecastPublisher from prediction.errorReporting import ErrorReporting from prediction.machineLearning import MachineLearning from prediction.predictionDataManager import PredictionData...
Viav022.py
import numpy as np import pandas as pd from scipy.sparse import csr_matrix, csgraph import scipy import igraph as ig import leidenalg import time import hnswlib import matplotlib.pyplot as plt import matplotlib import math import multiprocessing from scipy.sparse.csgraph import minimum_spanning_tree from scipy import s...
test_deployments.py
import json import os from multiprocessing import Process import pytest from jina.clients.request import request_generator from jina.enums import PollingType from jina.parsers import set_gateway_parser from jina.parsers import set_deployment_parser from jina.orchestrate.deployments import Deployment from jina import ...
susi_state_machine.py
"""This module declares the SUSI State Machine Class and Component Class. The SUSI State Machine works on the concept of Finite State Machine. """ import time import logging from threading import Thread from urllib.parse import urljoin import requests import json_config from speech_recognition import Recognizer, Micr...
test_application.py
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or with...
backgroundtask.py
import threading import time def your_function(): print("your code") class Execute(object): # set interval time def __init__(self, interval=10): self.interval = interval thread = threading.Thread(target=self.run, args=()) # if it is equal to false background task is not active ...
__init__.py
"""Web application stack operations.""" import logging import multiprocessing import os import sys import threading from typing import ( Callable, FrozenSet, List, Optional, Type, ) from galaxy.util.facts import get_facts from .handlers import HANDLER_ASSIGNMENT_METHODS log = logging.getLogger(__...
tarruda.py
"""Neovim TKinter UI.""" import sys from Tkinter import Canvas, Tk from collections import deque from threading import Thread # import StringIO, cProfile, pstats from neovim import attach from tkFont import Font SPECIAL_KEYS = { 'Escape': 'Esc', 'Return': 'CR', 'BackSpace': 'BS', 'Prior': 'PageUp', ...
index.py
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportErr...
gamepad.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2021 by Murray Altheim. All rights reserved. This file is part # of the Robot Operating System project, released under the MIT License. Please # see the LICENSE file included as part of this package. # # author: Murray Altheim # created: 2020-08-05 # ...
primes.py
import time from Queue import Queue from threading import Thread from random import normalvariate import collectd numbers = Queue() conn = collectd.Connection() def is_prime(n): for i in xrange(2, n): if n % i == 0: return False return True def watch_queue(): while True: conn...
one-time-pad.py
#!/usr/bin/env python3 # vim: set fenc=utf8 ts=4 sw=4 et : import sys import socket import random from threading import Thread with open("key.png", "rb") as f: SECRET = f.read() def client_thread(clientsocket): clientsocket.send(bytes([ SECRET[i] ^ random.getrandbits(8) for i in range(len(SEC...
__init__.py
# # Copyright (c) 2014, Scott Silver Labs, LLC. # # 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...
desktoppet.py
''' Function: 桌面宠物 Author: Charles 微信公众号: Charles的皮卡丘 ''' import os import sys import time import random import requests import threading from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5 import QtWidgets, QtGui '''配置信息''' class Config(): ROOT_DIR = os.path....
remote_executor.py
# Lint as: python3 # Copyright 2019, The TensorFlow Federated Authors. # # 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 ...
shell.py
# Date: 06/05/2018 # Author: Pure-L0G1C # Description: Recv/Send to master import sys import time from queue import Queue from threading import Thread, RLock class Shell(object): def __init__(self, sess_obj, interface): self.interface = interface self.sess = sess_obj self.is_alive = True s...
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 - ...
util.py
from typing import Optional, Callable, Union, Iterable, Any from inspect import Parameter, signature from multiprocessing.context import Process from multiprocessing import Queue from time import sleep, time from functools import wraps, partial from warnings import warn, simplefilter from contextlib import contextmanag...
parallel_map.py
from torch import multiprocessing from typing import Iterable, Callable, Any, List import time def parallel_map(tasks: Iterable, callback = Callable[[Any], None], max_parallel: int = 32) -> List: limit = min(multiprocessing.cpu_count(), max_parallel) processes: List[multiprocessing.Process] = [] queues: L...
engine.py
import copy import json import os import platform import queue import shlex import subprocess import sys import threading import time import traceback from typing import Callable, Dict, List, Optional from kivy.utils import platform as kivy_platform from katrain.core.constants import OUTPUT_DEBUG, OUTPUT_ERROR, OUTPU...
_send.py
import threading def send(self): # Kivy must stay on the main thread, other wise Kivy pauses self.check_if_all() self.start_gif() self.download_thread = threading.Thread(target=self.download) self.check_thread = threading.Thread(target=self.check_if_done) self.download_thread.start() self....
pool.py
# Copyright 2017 Red Hat, 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 writing, ...
packet_capture.py
""" Thread that continuously captures and processes packets. """ import scapy.all as sc import threading import time from host_state import HostState import utils from netfilterqueue import NetfilterQueue class PacketCapture(object): def __init__(self, host_state): assert isinstance(host_state, HostS...
test_dropbox.py
import multiprocessing import random import string import uuid import pytest from dvc.exceptions import DvcException from dvc.path_info import PathInfo from dvc.tree.dropbox import DropboxTree def rand_content(nchar): letters = string.ascii_lowercase prefix = "".join(random.choice(letters) for _ in range(10...
test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
roonapi.py
from __future__ import unicode_literals import os import threading import time from .constants import ( LOGGER, PAGE_SIZE, SERVICE_BROWSE, SERVICE_REGISTRY, SERVICE_TRANSPORT, CONTROL_VOLUME, ) from .discovery import RoonDiscovery from .roonapisocket import RoonApiWebSocket def split_media_p...
running.py
# Copyright 2019 The PlaNet 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 applicable...
server.py
import torch import torch.optim as optim import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torch.utils.data import TensorDataset, DataLoader from torch.autograd import Variable import pickle import lz4.frame import time import random import socket import copy ...
zipattack.py
# -*- coding: utf-8 -*- # @Author: lock # @Date: 2016-11-02 17:17:26 # @Last Modified by: lock # @Last Modified time: 2017-05-04 00:20:23 import zipfile import threading import optparse def extractFile(zFile, password): try: zFile.extractall(pwd=password) print("Key Found:", password) exit() except: pri...
main.py
import time import logging import chat import imp import traceback import json import re import math import sys import atexit import json from irc.bot import ServerSpec, SingleServerIRCBot from threading import Thread from os.path import isfile logging.basicConfig(filename="bot.log", level=logging.DEBUG) idata = "" m...
hilos.py
#!/usr/bin/env python import threading def worker(count): #funcion que realiza el trabajo en el thread print 'Muestro el valor %s para el hilo' % count return threads = list() for i in range(3): t = threading.Thread(target=worker, args=(i,)) threads.append(t) t.start()
performance_test.py
import requests from profile import profile from time import sleep import threading import psutil import hashlib API_KEY = "IAWMMTs0.cHddQPXa343hvAKcUY7FZHOyyT8Vo55h" API_SECRET = "IAWMMTs0" SUCCESS = 0 COUNTER = 1 @profile def make_request(i): global SUCCESS, COUNTER name = "onem.img" hash_md5 = hashlib...
logger.py
#!/usr/bin/env python # - * - Coding: utf-8 - * - import time import serial import logging import Queue from threading import Thread import json import logging from logging.handlers import FileHandler input_device = None output_devices = [] # Assig...
server.py
import time import json import cgi import threading import os.path import re import sys import logging import lesscpy from six import StringIO from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn from http.cookies import SimpleCookie from urllib.parse import unquote, quote...
dynamodump.py
#!/usr/bin/env python """ Simple backup and restore script for Amazon DynamoDB using boto to work similarly to mysqldump. Suitable for DynamoDB usages of smaller data volume which do not warrant the usage of AWS Data Pipeline for backup/restores/empty. dynamodump supports local DynamoDB instances as w...
test_io.py
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading import shutil import contextlib from tempfile import mkstemp, mkdtemp, NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np imp...
app.py
from flask import Flask, render_template, send_from_directory, request, send_file import os from threading import Thread from os import path from werkzeug.datastructures import MultiDict from werkzeug.utils import redirect, secure_filename from Facebook import madangowri app = Flask(__name__) file_path_main = path.a...
run.py
import sys from threading import Thread from queue import Queue from gdb_dap.reader import reader_thread from gdb_dap.writer import writer_thread from gdb_dap.gdb_dap import json_process if __name__ == "__main__": thread = None reader = None writer = None read_from = sys.stdin.buffer write_to = sy...
gym_environment.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from multiprocessing import Process, Pipe import numpy as np import cv2 import gym from environment import environment from sam.spectral_residual_saliency import SpectralResidualSalienc...
nets_udp_client.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import time import threading from socket import * class UdpClient(object): def __init__(self, host='127.0.0.1', port=6001): self.Host = host self.Port = port self.BufSize = 4096 self.Addr = (self.Host, self.Port) ...
main.py
import threading import Xlib from Xlib.display import Display from Xlib import X, XK from Xlib.protocol import event from normal import normal_mode class Manager(): def __init__(self, inkscape_id): self.id = inkscape_id self.disp = Display() self.screen = self.disp.screen() self.root = self.screen.root se...
utils.py
#!/usr/bin/env python """This file contains various utility classes used by GRR.""" import array import base64 import copy import cStringIO import errno import functools import getpass import os import pipes import platform import Queue import random import re import shutil import socket import stat import struct impo...
fileStore.py
# Copyright (C) 2015-2018 Regents of the University of California # # 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 app...
text_interface.py
from __future__ import print_function import sys, os, re import argparse, shutil from .config import RobotConfig from .sequencerobot import SequenceRobot import random, time import threading from getch import getch import yaml import json #with open(r'..constants.yaml') as file: #constants = yaml.load(file, Loader=...
slack.py
''' Use a 'bot' to post message to a Slack channel. This is useful for error alerts and scheduled notifications. ''' import json import threading import urllib.request import arrow # Reference: # search for 'incoming webhooks for slack' def post(channel_webhook_url: str, subject: str, text: str) -> None: dt = a...
ippool.py
#utf-8 import random import threading from functools import partial from pytdx.log import DEBUG, log import time from collections import OrderedDict """ ips 应该还是一个 (ip ,port) 对的列表,如 [ (ip1, port1), (ip2, port2), (ip3, port3), ] """ class BaseIPPool(object): def __init__(self, hq_class): se...
services.py
import os import subprocess import sys import threading # Not used now, leaving it here for future use with command line tools class LineSubProcess(object): """ Class to communicate with arbitrary line-based bash scripts. Uses various mechanism to enforce line buffering. # When calling python scripts ...
autonomous_v7.py
''' Notes: After executing ctrl-z, the nn isn't taking the second-best proba from the previous prediction array. It's making a new prediction, and then going with the second-best from that array. In v.8, make it take the second-best from the previous prediction. ''' import car import cv2 import numpy as np import os ...
windows.py
import fs.smbfs from tkinter import* from tkinter import messagebox import threading #--------------------------SMb--------------------- number = 0 password_list = [] bools = True def read(target,numbers): global number global password_list messagebox.showinfo("密码破解","破解开始,详情请见命令行") print('开...
planner.py
#!/usr/bin/env python #-*- coding:utf-8 -*- import threading,math import rospy,tf from geometry_msgs.msg import Twist from std_msgs.msg import * planner_status = False steering_last = 0.0 def start_planner_sub(data): global planner_status planner_status = data.data print 'planner_status = ',planner_st...
main.py
''' Project: Kail Birthday Present Author(s): Pekka Lehtikoski and Sofie Lehtikoski Description: An expandable life-manager device, starting with an alarm clock and inspirational message selector. :) ''' import time import datetime import RPi.GPIO as GPIO import threading from pygame import ...
analy_GUI_ver0.01.py
## 영상 처리 및 데이터 분석 툴 from tkinter import *; import os.path ;import math from tkinter.filedialog import * from tkinter.simpledialog import * ## 함수 선언부 def loadImage(fname) : global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH fsize = os.path.getsize(fname) # 파일 크기 확인 inH...
sqlite_web.py
#!/usr/bin/env python import operator import datetime import math import optparse import os import re import sys import threading import time import webbrowser from collections import namedtuple, OrderedDict from functools import wraps from getpass import getpass # Py3k compat. if sys.version_info[0] == 3: binary_...
video_source.py
from queue import Queue from threading import Thread import cv2 from .. import utils class VideoSource: def __init__( self, source, size, padding, buffer_size = 100): self.__source = source self.__size = size self.__padding = padding self.__buffer_size = buffer_size ...
slp_dagging.py
""" Breadth-first DAG digger for colored coins. We do a breadth-first DAG traversal starting with the transaction-of-interest at the source, and digging into ancestors layer by layer. Along the way we prune off some connections, invalidate+disconnect branches, etc., so our 'search DAG' is a subset of the transaction D...
TncModel.py
#!/bin/env python2.7 from __future__ import print_function, unicode_literals from builtins import bytes, chr import threading import serial import time import datetime import math import traceback from io import StringIO, BytesIO from struct import pack, unpack from gi.repository import GLib from BootLoader import Bo...
powcoin_four.py
""" POWCoin Part 4 * Node.handle_block supports creation and extension of branches, but doesn't yet do reorgs * Define Node.find_in_branch() * Define Block.__eq__ * Fix how Tx.__repr__ handles genesis block Usage: powcoin_four.py serve powcoin_four.py ping [--node <node>] powcoin_four.py tx <from> <to> <amount> ...
lifebox-test.py
import pygame import sys import random import threading import time from pyfirmata import ArduinoMega, util datafromfile = [0] * 21 def map(x,in_min,in_max,out_min,out_max): return float((float(x) - float(in_min)) * (float(out_max) - float(out_min)) / (float(in_max) - float(in_min)) + float(out_min)) def readdataf...
virtual_light_switch.py
#!/usr/bin/env python # encoding: utf-8 ''' Created on June 19, 2016 @author: David Moss ''' # This module will emulate a light switch device. import requests import sys import json import threading import time import logging from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter _htt...
main.py
import os import sys from . import __version__ from .root import ( root, config, change_siz, ) from .menu import bind_menu from .tab import ( nb, bind_frame, delete_curr_tab, cancel_delete, create_new_reqtab, create_new_rsptab, create_helper, change_tab_name, send_reque...
test_kex_gss.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # Copyright (C) 2013-2014 science + computing ag # Author: Sebastian Deiss <sebastian.deiss@t-online.de> # # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Les...
counter.py
from bottle import post, run, request import threading import time count = 0 @post('/') def index(): global count count += int(request.body.read()) return b'' def show(): prev = 0 while True: start = time.time() time.sleep(1) now = time.time() dur = now - start ...
server.py
# Copyright (c) 2021 PaddlePaddle 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 appli...
tube.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division import logging import re import six import string import subprocess import sys import threading import time from six.moves import range from pwnlib import atexit from pwnlib import term from pwnlib.context import context f...
concurrent_workload.py
#!/usr/bin/env impala-python # # 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 (...
event_handler.py
import pygame import sys import core_communication import socket from multiprocessing import Process from pygame.locals import * def start_server(): execfile("server.py") class EventLogic: def __init__(self, _game_state, _game_gui): self._game_state = _game_state self._game_gui = _game_gui ...
impact.py
# encoding: UTF-8 """Library for running an EPICS-based virtual accelertor using IMPACT particle tracker.""" import cothread import logging import math import numpy import os.path import random import re import shutil import subprocess import tempfile import threading import time from collections import OrderedDict f...
rebound.py
########## ## GLOBALS ########## import urwid import re import sys import os from bs4 import BeautifulSoup import requests from queue import Queue from subprocess import PIPE, Popen from threading import Thread import webbrowser import time from urwid.widget import (BOX, FLOW, FIXED) import random SO_URL = "https://...
portable_runner.py
# # 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 "License"); you may not us...
camera_demo.py
import time import threading import tkinter as tk from PIL import Image from PIL import ImageTk import cv2 # Prepare the window window = tk.Tk() window.title('Camera Demo') window.geometry('640x480') # Creates a thread for openCV processing def start_as_background_task(loop_function): run_event = threading.Event(...
mySerial.py
import numpy as np import serial # 导入模块 import serial.tools.list_ports import threading import time # 返回 成功读入的字节数 def checkPorts(): return [sp.device for sp in serial.tools.list_ports.comports()] class Port: def __init__(self, portname='com9', bps=115200, maxtime=1, bytesize=8, parity='none', stopbits=1): ...
unparse.py
from ast import parse from os import link from mysql.connector import connection from telegram.parsemode import ParseMode import modules.core.extract as extract import time import threading import itertools from multiprocessing.pool import ThreadPool import modules.core.database as database from modules.core.warn imp...
data_watcher ver 2.py
from threading import Thread class Watch: """ Watch class to implement a data-observer pattern on the encapsulated data item. The event-handlers/callbacks will be ran when the data is changed/set. """ # __on_set_cbs callback functions run the moment set method is used to set a value to the variable. ...
scheduler.py
from __future__ import print_function import socket import uuid import itertools import traceback import sys import random from collections import defaultdict from multiprocessing.pool import ThreadPool from datetime import datetime from threading import Thread, Lock, Event from contextlib import contextmanager impor...
maestroflow.py
import requests from aiohttp import web import threading import queue import asyncio import time import signal import sys import os import base64 import socket def get_open_port(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("",0)) s.listen(1) port = s.getsockname()[1] s.c...
__init__.py
# Copyright 2018 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...
__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import import datetime import json import logging import os import random import re import sys import time import Queue import threading import shelve import uuid from geopy.geocoders import GoogleV3 from pgoapi import PGo...
maingui.py
from mainwin import * from PyQt5.QtCore import (QByteArray, QDataStream, QFile, QFileInfo, QIODevice, QPoint, QPointF, QRectF, Qt, QTimer) from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog,QGraphicsScene,QGraphicsPixmapItem,QGraphicsItem,QStyle,QGraphicsTextItem,QMenu from PyQ...
via65c22.py
import sys import time import threading from py65.utils import console from py65816.utils import db_console class VIA(): SR = 4 SET_CLEAR = 128 def __init__(self, start_addr, mpu): self.mpu = mpu self.VIA_SR = start_addr + 0x0a # shift register self.VIA_IFR = start_addr + 0x0d...
conftest.py
import collections import contextlib import platform import socket import ssl import sys import threading import pytest import trustme from tornado import ioloop, web from dummyserver.handlers import TestingApp from dummyserver.server import HAS_IPV6, run_tornado_app from dummyserver.testcase import HTTPSDummyServerT...
BakSql.py
#!/usr/bin/python3 import sys import time import os import zipfile import threading import Config from DirOrFileToOSS import DirOrFileToOSS isDelFile = True db_host = Config.db_host db_user = Config.db_user db_passwd = Config.db_passwd db_name = Config.db_name db_charset = Config.db_charset mysqldump_path = Config.mys...
_fail_fork.py
import signal import multiprocessing as mp from openmp_parallel_sum import parallel_sum if __name__ == '__main__': import argparse parser = argparse.ArgumentParser('Test compat openMP/multproc') parser.add_argument('--start', type=str, default='fork', help='define start method tes...
ReliableCommunication.py
import socket from datetime import datetime import socket, time, threading, time, sys, json ''' TCP Server class ''' class Server: MAX_CLIENTS = 5 PORT_IN_USE_TIMEOUT = 3 def __init__(self, address, port, messageDataType="json", byteOrder="little", sendMostRecent=True): ''' Create a TCP Se...
zipcracker.py
import os import optparse import zipfile from pyfiglet import figlet_format from threading import Thread os.system("clear") print (" MYANMAR ANONYMOUS FAMILY. ") print (figlet_format("ZIP CRACKER")) print ("___________________________________") print ("Author : BhonePyae") print ("Email : bptz...
watchdog.py
# -*- coding: utf-8 -*- from kazoo.client import KazooClient import os import sys import logging import time import signal from multiprocessing import Process main_dir = "/root/V3/project/" signal_dir = '/signal/huanqiunews' task_type = "huanqiunews" def run_proc(): os.chdir(main_dir +"huanqiunews/huanqiunews/spid...
compare_Walternating_sgd_1layers.py
import qiskit import numpy as np import sys sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding import importlib import multiprocessing importlib.reload(qtm.base) importlib.reload(qtm.constant) importlib.reload(qtm.onequbit) importlib.reload(qtm.nqubit) importlib.reload(q...
auto_mode_turn_yaw_V1.py
import airsim import numpy as np import math from math import cos,sin,radians,degrees import os import pprint import cv2, time, timeit, threading, sys import random import my_fuzzyController def adjYaw(): global tag_time while True: tag_time += 1 time.sleep(1) """--------------------------- GE...
threaded_reader.py
import queue import threading from ...formats import dictset def threaded_reader(items_to_read: list, blob_list, reader): """ Speed up reading sets of files - such as multiple days worth of log-per-day files. Each file is read in a separate thread, up to 8 threads, reading a single file using thi...
random_shuffle_queue_test.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...