source
stringlengths
3
86
python
stringlengths
75
1.04M
server.py
import queue import threading import uuid from concurrent import futures from datetime import datetime, timedelta import fedn.proto.alliance_pb2 as alliance import fedn.proto.alliance_pb2_grpc as rpc import grpc from fedn.combiner.role import Role from scaleout.repository.helpers import get_repository CHUNK_SIZE = 10...
socket_adapter.py
import remotefile import socket import numheader import threading import sys @remotefile.TransmitHandler.register class TcpSocketAdapter: """ Remotefile TCP socket adapter """ def __init__(self, nagle=True): self.isConnected = False self.isAlive = False # a recei...
back_reset.py
import json import sqlite3 from multiprocessing import Process from func import * from set_mark.mark import * json_data = open('set.json').read() set_data = json.loads(json_data) conn = sqlite3.connect(set_data['db'] + '.db') curs = conn.cursor() def go_namu(data): for end in data: print(end[0]) ...
test_numexpr.py
################################################################### # Numexpr - Fast numerical array expression evaluator for NumPy. # # License: MIT # Author: See AUTHORS.txt # # See LICENSE.txt and LICENSES/*.txt for details about copyright and # rights to use. ##########################################...
worker.py
import glob import json import logging import os import tarfile import time import traceback from datetime import datetime, timedelta from pathlib import Path from threading import Thread from typing import Optional, List import requests from waffles.api.abstract.handler import TaskManager, ProcessWatcher from waffle...
Upload.py
from Connection import * """description of class""" from sense_hat import SenseHat import os, pyrebase, pubnub, sys, time, datetime; def get_mac(): import uuid mac_num = hex(uuid.getnode()).replace('0x', '').upper() mac = '-'.join(mac_num[i: i + 2] for i in range(0, 11, 2)) return mac SENSE = SenseHa...
test_basic.py
import re import sys import time import uuid from datetime import datetime from threading import Thread import pytest import werkzeug.serving from werkzeug.exceptions import BadRequest from werkzeug.exceptions import Forbidden from werkzeug.exceptions import NotFound from werkzeug.http import parse_date from werkzeug....
song-crawler2.py
import requests import re from bs4 import BeautifulSoup import json import time import threading import os import pickle headers = { "Host":"music.163.com", "Referer":"http://music.163.com/", "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.3...
evaluator.py
# -*- coding: utf-8 -*- # Copyright 2013-2021 CERN # # 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...
dead_pool.py
__author__ = 'July' import threading import os import sys def dead_loop(): while True: pass #t = threading.Thread(target = dead_loop) #t.start() dead_loop() #t.join() print sys.setcheckinterval
console.py
#!/usr/bin/env python3 import os import sys import argparse import serial import threading import time def read_handler(): while True: try: b = serial_port.read() s = b.decode('ascii') except UnicodeDecodeError: print(repr(b), end='') pass el...
test_signal.py
import unittest from test import support from contextlib import closing import gc import pickle import select import signal import struct import subprocess import traceback import sys, os, time, errno from test.script_helper import assert_python_ok, spawn_python try: import threading except ImportError: threadi...
Rat_Experiment_1_8BoundaryCell.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...
sdb.py
from __future__ import print_function import cmd import contextlib import errno import logging import os import pprint import re import rlcompleter import select import signal import socket import sys import termios import threading import traceback import tty from multiprocessing import process from pdb import Pdb im...
bridge.py
#!/usr/bin/env python3 import argparse import carla # pylint: disable=import-error import math import numpy as np import time import threading from cereal import log from multiprocessing import Process, Queue from typing import Any import cereal.messaging as messaging from common.params import Params from common.numpy...
main.py
''' Created on Dec 21, 2020 @author: rcurtis ''' import logging import sys import threading import time logging.basicConfig(filename='WolfBot.log', level=logging.INFO, format='%(asctime)s %(levelname)s %(threadName)s %(module)s:%(funcName)s :: %(message)s ', datefmt='%m/%d/%...
onsets_frames_transcription_realtime.py
# Copyright 2022 The Magenta 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 by applicable law or agreed to in ...
release.py
#!/usr/bin/python import re import sys import os import os.path import subprocess import shutil import tempfile from datetime import * from multiprocessing import Process from utils import * try: from xml.etree.ElementTree import ElementTree except: prettyprint(''' Welcome to the Infinispan Release Script....
screens.py
import asyncio from decimal import Decimal import threading from typing import TYPE_CHECKING, List, Optional, Dict, Any from kivy.app import App from kivy.clock import Clock from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.factory import Factory from kivy.uix.recycleview import Recycl...
serverprox.py
from flcore.clients.clientprox import clientProx from flcore.servers.serverbase import Server from utils.data_utils import read_client_data from threading import Thread class FedProx(Server): def __init__(self, device, dataset, algorithm, model, batch_size, learning_rate, global_rounds, local_steps, join_clients,...
time_sanitizer.py
#!/usr/bin/env python3 # # Copyright 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import ctypes from ctypes.util import find_library import logging import math import os import threading import t...
jobs.py
# -*- coding: utf-8 -*- # # 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, software ...
weatherflow.py
#!/usr/bin/env python3 """ Polyglot v2 node server for WeatherFlow Weather Station data. Copyright (c) 2018,2019 Robert Paauwe """ import polyinterface import sys import time import datetime import urllib3 import json import socket import math import threading import node_funcs from nodes import temperature from nodes ...
utils.py
import os, sys, queue, time, random, re, json import datetime, traceback, pickle import multiprocessing, copy from base import Network, NetworkItem, Cell from info_str import NAS_CONFIG, MF_TEMP def _dump_stage(stage_info): _cur_dir = os.getcwd() stage_path = os.path.join(_cur_dir, "memory", "stage_i...
compile_json.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import Queue import threading import pykeyvi import argparse import os import gzip import unicodedata, re control_chars = ''.join(map(unichr, range(0,32))) control_char_re = re.compile('[%s]' % re.escape(control_chars)) def remove_control_chars(s): return ...
client.py
import argparse import os import sys import threading import re import time from pathlib import Path import grpc # **************************************modify here to add syspath if you need. *************************** _current_root = str(Path(__file__).resolve().parents[1]) sys.path.append(_current_root) sys.path....
GUI_client.py
import socket import threading import time from Tkinter import * client = socket.socket() client.connect(('localhost' , 63453)) root = Tk() def send(): data_send = get_message.get() if data_send != "": data_send = str(data_send) client.send(data_send) lbl = Label(root , text=data_send , bg="red" , fg="white...
smtclient.py
# Copyright 2017,2021 IBM Corp. # # 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 agr...
decorators.py
from threading import Thread from types import MethodType from selenium.common.exceptions import NoSuchElementException from .exceptions import InvalidArgumentError from .log_adapter import get_logger class task_runner(object): def __init__(self, func): self.func = func self.background = False...
demoAll-prg-multi.py
""" 4 demo classes run as independent program processes: multiprocessing; multiprocessing allows us to launch named functions with arguments, but not lambdas, because they are not pickleable on Windows (Chapter 5); multiprocessing also has its own IPC tools like pipes for communication; """ from tkinter import...
semantic.py
""" Uses semantic to obtain an AST for a given code snippet in a language supported by semantic. This code is based on a semantic version that still supports the `--json-graph` option! Newer versions of semantic have dropped that command line option and it is unclear if it will return! To ensure this code will work wit...
nodes.py
# Python3 # # Returns list of live tested nodes sorted by latency # # (BTS) litepresence1 from multiprocessing import Process, Value, Array from bitshares.blockchain import Blockchain from bitshares import BitShares from datetime import datetime import requests import time import sys import os ID = '4018d7844c78f6a6...
xml_reporter_test.py
# Copyright 2017 The Abseil 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 by applicable law or agreed to in ...
python_ls.py
# Copyright 2017 Palantir Technologies, Inc. import logging import socketserver import threading from jsonrpc.dispatchers import MethodDispatcher from jsonrpc.endpoint import Endpoint from jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter from . import lsp, _utils, uris from .config import config from ....
Rat_Experiment_1_12BoundaryCell.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...
server_rpc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/server/server_rpc.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice...
load_full_dataset.py
# MIT License # Copyright (c) 2020 Yaohua Liu # 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 # to use, copy, modify, merge, pub...
eyetracker.py
#Identify pupils. Based on beta 1 import numpy as np import cv2 import time import threading import recorder start_time = time.time() prev_time = 0 STOP = False eyeMovement = [] def showImage(tempVar, pupilFrame): for i in tempVar[0,:]: cv2.circle(pupilFrame,(i[0],i[1]),i[2],(0,255,0),2) cv2.circle(pupilF...
pvctrls.py
import time import threading import socket import struct from p4p.nt import NTScalar from p4p.server.thread import SharedPV from psdaq.pyxpm.pvseq import * from psdaq.pyxpm.pvhandler import * provider = None lock = None class TransitionId(object): Clear = 0 Config = 2 Enable = 4 Disable = 5 c...
py_bitflyer_jsonrpc.py
#!/usr/bin/python3 # coding: utf-8 import websocket import threading import traceback from time import sleep import json import logging class BitflyerJSON_RPC: MAX_LIMIT_LEN = 1000 ''' # # symbolに購読する通貨セットを指定してください # 'BTC_JPY','FX_BTC_JPY','ETH_BTC', or futures # recconect: エラー発生時に再接続するか...
logic.py
# coding: utf-8 import json import time from threading import Thread, Lock id = 0 id_lock = Lock() users = {} users_lock = Lock() groups = {} groups_lock = Lock() id_heartbeat_dict = {} heartbeat_lock = Lock() def register(ip,port,username): global id_lock global users_lock global heartbeat_lock global...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
webfunctions.py
import time import json import threading import multiprocessing import logging import sys from serverbot import start_server from constants import CONFIGS_, BOTSERVER, TELEGRAM_TOKEN bot_online = False svision_response = { 'name': 'svision-server', 'status': 'ok', 'system': 'svision', 'code': 100, ...
WatchCat.py
# # Facharbeit2021WatchCat dies ist der Bot welcher die Alarmanlage Steuert und die Schnitstelle zwichen User und Programm darstellt # Also quasi DER rosa Elephant unter den Rosa Elephanten # # v3.2 # import discord # Wie immer die Discord Lib import asyncio # Für asyncrone Methoden import time # Für die Zeit impor...
ThreadOutput.py
import queue import sys import threading import time class ThreadOutput: """ This class enables simplistic capturing and retrieving output from subprocesses while they are running. """ def __init__(self, prefix): """ Create ThreadOutput object, output using the dump method will be pre...
lib.py
from __future__ import absolute_import, unicode_literals import logging import time from threading import Thread, Event from . import settings, io logger = logging.getLogger(__name__) _done_locking_or_unlocking = Event() _done_locking_or_unlocking.set() def get_locked(): # Wait until we have a steady state. ...
test1.py
import time import os import hither2 as hi import multiprocessing thisdir = os.path.dirname(os.path.realpath(__file__)) @hi.function( 'test1', '0.1.0', image=hi.DockerImageFromScript(dockerfile=f'{thisdir}/example_functions/docker/Dockerfile.numpy', name='magland/numpy') ) def test1(): print('test1') p...
test_html.py
from __future__ import print_function import os import re import threading from functools import partial import pytest import numpy as np from numpy.random import rand from pandas import (DataFrame, MultiIndex, read_csv, Timestamp, Index, date_range, Series) from pandas.compat import (map, zip,...
utils.py
import atexit import csv import os import sys import time import traceback from datetime import datetime from functools import wraps from multiprocessing import Process, Queue import numpy as np import pandas as pd import psutil import ujson from experiment_impact_tracker.data_utils import * from experiment_impact_tr...
monitoring_server.py
import socket import threading import time from sentiment_predict import sentiment_predict # 모든 아이피 접속 host = "0.0.0.0" port = 5000 #백그라운드에서 클라이언트가 보낸 메시지를 수신하기 위해 대기합니다. def handle_client(client_socket, addr): while True: time.sleep(1) data = client_socket.recv(1024) data ...
carpe_daemon.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys, time, subprocess from datetime import datetime import pika import functools import threading import json import carpe_am_module # Debugging Module import pdb def ack_message(channel, delivery_tag): if channel.is_open: channel.basic_ack(delivery_tag) el...
api_unit_test.py
import math import os import sys import threading import time import unittest # these imports are needed to generate data objects. from fprime.common.models.serialize.numerical_types import I32Type, U32Type from fprime.common.models.serialize.time_type import TimeType from fprime_gds.common.data_types.ch_data import C...
lisp.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...
handler.py
import logging import time from collections import defaultdict from queue import Queue from threading import Thread from kube_hunter.conf import get_config from kube_hunter.core.types import ActiveHunter, HunterBase from kube_hunter.core.events.types import Vulnerability, EventFilterBase, MultipleEventsContainer logg...
webcamStream.py
from threading import Thread import cv2 class WebcamStream: def __init__(self, src=0): self.stream = cv2.VideoCapture(src) (self.grabbed, self.frame) = self.stream.read() self.stopped = False def start(self): self.stopped = False Thread(target=self.update, arg...
mock_server.py
import json import re import socket from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Thread import requests import tests class MockGitlabServer(BaseHTTPRequestHandler): PIPELINE = re.compile(r'pipelines') PROJECTS = re.compile(r'projects') PER_PAGE = re.compile(r'per_page...
tests.py
from __future__ import unicode_literals from datetime import datetime import threading from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import connections, DEFAULT_DB_ALIAS from django.db import DatabaseError from django.db.models.fields import Field from django.db.models....
state.py
import os import pickle import re import time from threading import RLock, Thread, Event, current_thread, _MainThread from . import common from . import unicurses as uc from .command import CommandProcessor, TextQuery from .config import Config from .model import ( UnableToFindDevice, NoneTrack, Playlist, ...
tweets.py
import requests, time, json, threading, asyncio, os, numpy as np from nltk.sentiment.vader import SentimentIntensityAnalyzer from typing import Any, Dict from concurrent.futures import ThreadPoolExecutor from data.es import add_analyses from config.symbols import focus_symbols from config.models import TweetData, Anal...
unicorn_binance_websocket_api_manager.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/uni...
_server_adaptations.py
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
ipython_memory_usage.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Profile mem usage envelope of IPython commands and report interactively""" from __future__ import division # 1/2 == 0.5, as in Py3 from __future__ import absolute_import # avoid hiding global modules with locals from __future__ import print_function # force use of pri...
ncbi_ftp_assembly_download.py
#!/usr/bin/env python3 from olctools.accessoryFunctions.accessoryFunctions import make_path, SetupLogging from argparse import ArgumentParser from click import progressbar from threading import Thread from subprocess import call from queue import Queue from ftplib import FTP from time import sleep import logging import...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import queue as pyqueue import contextlib import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import struct import operator import w...
email.py
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: email Description : 电子邮件支持函数 Author : Liangz Date: 2018/11/8 ------------------------------------------------- Change Activity: 2018/11/8: ------------------------------------...
test_basic.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from concurrent.futures import ThreadPoolExecutor import json import logging import os import random import re import setproctitle import shutil import six import socket impor...
network.py
# standard library imports import socket import logging import subprocess import threading import socketserver import os from typing import Callable from collections import defaultdict from uuid import getnode as get_mac # 20.05.2019 # Starting to use typing from typing import Any, ByteString, Dict, Tuple # third pa...
client.py
import requests import random import threading import time import logging import socket import sys frontend = 'frontend' concurrency = 2 def do_request(s): addrs = socket.getaddrinfo(frontend, 80) if len(addrs) <= 0: return addr = random.choice(addrs) s.get("http://%s:%d" % addr[4], timeout=1.0) def do_r...
client.py
import http.client import json import logging import threading from urllib.parse import quote_plus from .handler import ADMIN_PATH, CaptureRequestHandler from .server import ProxyHTTPServer log = logging.getLogger(__name__) class AdminClient: """Provides an API for sending commands to a remote proxy server.""" ...
instance.py
import atexit import time import logging import os import socket import io import sys import threading import paramiko import aws_resources # The ARN of an IAM policy that allows full access to S3. S3_FULL_ACCESS_ARN = "arn:aws:iam::aws:policy/AmazonS3FullAccess" # The URL to GET from within an instance in order to...
basehandler.py
import functools import threading import tornado.web class BaseHandler(tornado.web.RequestHandler): @property def logger(self): return self.application.logger def initialize(self): """initialize database connection: it is called before prepare function""" pass def run_asynchrono...
app.py
#!/usr/bin/env python from flask import Flask, render_template, request, jsonify from flask_socketio import SocketIO, emit import json import os import git from git import repo import threading import rclpy from rclpy.node import Node from std_msgs.msg import Float32MultiArray # Define templates path and static file...
node.py
#!/usr/bin/env python3 # pylint: disable=too-many-instance-attributes # pylint: disable=too-few-public-methods # pylint: disable=too-many-arguments # pylint: disable=useless-import-alias ''' abstraction of a server that allows communciation with other nodes ''' import os import queue import socket import socketserve...
update.py
import sqlite3 from spider import get_detail, get_news_list, DB, MAX_THREADS from queue import Queue from threading import Thread import datetime date_q = Queue() sid_q = Queue() with sqlite3.connect(DB) as conn: TODAY = datetime.date.today().strftime('%Y%m%d') (LAST_DAY, _) = conn.execute('SELECT max(pub_da...
thread_local.py
""" create thread demo """ import threading import time my_data = threading.local() def do_it2() -> None: """ do it 2 function """ print(threading.current_thread().name + ":" + my_data.x) def do_it(sleep_time: int) -> None: """ do it function """ time.sleep(sleep_time) print("".join([ ...
log.py
#!/usr/bin/env python """ Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ import os import signal import socket import SocketServer import sys import threading import time import traceback from core.common import check_whitelisted ...
test_selenium.py
import re import threading import time import unittest from selenium import webdriver from app import create_app, db from app.models import Role, User, Post class SeleniumTestCase(unittest.TestCase): client = None @classmethod def setUpClass(cls): # 开始 Firefox try: cls.cli...
test-zmq.py
#!/usr/bin/env python import zmq import time import sys import random from multiprocessing import Process def server_push(port="5556"): context = zmq.Context() socket = context.socket(zmq.PUSH) socket.bind("tcp://*:%s" % port) print "Running server on port: ", port # serves only 5 request and die...
ClientSide3.py
# EXECUTAR COM UMA IDE DEDICADA (VSCODE, PYCHARM, ATOM...) PARA UMA PERFORMANCE INTEGRAL import socket import threading from time import perf_counter, sleep from random import randint from cryptography.fernet import Fernet # CMD/Linux Command: $pip install cryptography def crypto_tolls(): key = b'n05rzNJNF-tU4H-o...
MegaAnonym.py
from flask import Flask, request, jsonify import json from ask_sdk_core.skill_builder import SkillBuilder from ask_sdk_core.dispatch_components import AbstractRequestHandler from ask_sdk_core.utils import is_request_type, is_intent_name from ask_sdk_core.handler_input import HandlerInput from ask_sdk_model.ui import S...
b2fuse_main.py
# The MIT License (MIT) # Copyright 2021 Backblaze Inc. All Rights Reserved. # Copyright (c) 2015 Sondre Engebraaten # 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, inc...
manager.py
""" This module defines the Manager class. """ import atexit from collections import deque from heapq import heappop, heappush from inspect import isfunction from itertools import chain, count from multiprocessing import Process, current_process from operator import attrgetter from os import getpid, kill from signal im...
main.py
''' Created on Aug 13, 2014 @author: Mike @details GUI interface allowing user to: configure pulse width for each axis jog the X, Y, Z axis or jog XY axis at the same time transmit parsed gcode to firmware for routing, start pause and clear r...
kaldi_io.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014-2016 Brno University of Technology (author: Karel Vesely) # Licensed under the Apache License, Version 2.0 (the "License") import numpy as np import sys, os, re, gzip, struct ################################################# # Adding kaldi tools to shel...
rc_driverv2.py
import threading import SocketServer import serial import cv2 import numpy as np import math # distance data measured by ultrasonic sensor sensor_data = " " class NeuralNetwork(object): def __init__(self): self.model = cv2.ANN_MLP() def create(self): layer_size = np.int32([38400, 32, 4]) ...
test_helloword2.py
import pytest import threading import time from flask import request, Blueprint from selenium import webdriver from dotenv import load_dotenv from alfred3.testutil import get_app load_dotenv() testing = Blueprint("test", __name__) @testing.route("/stop") def stop(): func = request.environ.get('werkzeug.server...
autotyper.py
from pynput.keyboard import Key,Controller import time from datetime import datetime import threading keyboard = Controller() print(" .o. . o8o . .o8 \n" " .888. .o8 ` ' .o8 ...
herm3s_Slave.py
import socket, time, threading, subprocess, os, sys from sys import executable, exit from shutil import copy, move from subprocess import Popen, PIPE, call # values sv_ip = '127.0.0.1' sv_port = 3223 retry_delay_connect = 5 password = 'change_me' default_name = 'Slave_t3st' base_name = os.path.basename(sys.executable...
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...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import io import errno import os import threading import time try: import ssl except ImportError: ssl = None from unittest import Test...
_generic.py
# -*- coding: utf-8 -*- from threading import Thread, Lock import traceback import functools try: from queue import Queue except ImportError: from Queue import Queue class GenericListener(object): lock = Lock() def __init__(self): self.handlers = [] self.listening = False self...
take_human_input_v1.py
#!/usr/bin/python import time import rospy import roslib; roslib.load_manifest('bwi_tasks') import actionlib from bwi_kr_execution.msg import * import segbot_gui.srv import bwi_rlg.srv from multiprocessing import Process, Value human_waiting = False next_room = None def get_human_waiting(): global human_waiti...
patternsAPI.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from ctypes import cdll, create_string_buffer import os import time import threading class detection: multiPatternLib = None video = None OBJECT_MAX = 30 exit_th = False lock_data = None refresh_delay = 0.1 data_params = None def __init_...
binpickingcontrollerclient.py
# -*- coding: utf-8 -*- # Copyright (C) 2013-2015 MUJIN Inc. # Mujin controller client for bin picking task # mujin imports from . import realtimerobotclient # logging import logging log = logging.getLogger(__name__) class BinpickingControllerClient(realtimerobotclient.RealtimeRobotControllerClient): """mujin c...
job.py
from threading import Thread from datetime import datetime, timedelta from loguru import logger from event_stream import EventStream, Event class Job: def __init__(self, func, name, interval, sync, run_thread: bool, offset: int): self.func = func self.name = name self.interval = interval...
concurrent_select.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 (...
pool.py
import heapq import os import threading import time from peewee import * from peewee import _savepoint from peewee import _transaction from playhouse.pool import * from .base import BaseTestCase from .base import ModelTestCase from .base_models import Register class FakeTransaction(_transaction): def _add_histo...
OriginalDataExtractor.py
import urllib import difflib import pickle import json import threading import sys import getopt reload(sys) sys.setdefaultencoding('utf8') def getHtml(url): page = urllib.urlopen(url) html = page.read() return html def extract_raw_problom(str_html): meta_problem_title = "<meta n...
jd_OpenCard.py
#!/bin/env python3 # -*- coding: utf-8 -* ''' 项目名称: JD_OpenCard Author: Curtin 功能:JD入会开卡领取京豆 CreateDate: 2021/5/4 下午1:47 UpdateTime: 2021/6/19 ''' version = 'v1.2.2' readmes = """ # JD入会领豆小程序 ![JD入会领豆小程序](https://raw.githubusercontent.com/curtinlv/JD-Script/main/OpenCrad/resultCount.png) ## 使用方法 #### [手机用户(参考) https:/...
bot.py
import asyncio import base64 import concurrent.futures import datetime import glob import json import math import os import pathlib import random import sys import time from json import dumps, loads from random import randint import re from re import findall import requests import urllib3 from Crypto....