source
stringlengths
3
86
python
stringlengths
75
1.04M
_render.py
from MA import * from MSV import * from threading import Thread from bokeh.models.tickers import FixedTicker def render(self, render_all=False, ignorable=True): self.widgets.show_spinner(self) self.reset_runtimes() self.reset_cds() if self.xs < 0: self.xs = 0 if self.ys < 0: self.ys...
copyutil.py
# cython: profile=True # 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 # "...
fc_2015_02_26.py
#!/usr/bin/env python3 # imports go here from gevent import monkey monkey.patch_all() import time from threading import Thread from github import Github import os from flask import Flask, render_template from flask.ext.socketio import SocketIO # # Free Coding session for 2015-02-26 # Written by Matt Warren # app =...
helper.py
from __future__ import annotations import asyncio import math import json import threading from sphero.sphero_bolt import SpheroBolt import numpy as np from cv2 import cv2 from typing import List # CAP = None CURRENT_COORDINATES = {} def get_json_data(file: str) -> List[dict[str, str]]: """Reads json file and re...
house_keeping.py
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
conftest.py
import asyncio import json import os import threading import time import typing import pytest import trustme from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import ( BestAvailableEncryption, Encoding, PrivateFormat, load_pem_private_key, ) from...
cron.py
import multiprocessing import os import sys import traceback from pysigner.mesosphere_signer import get_configs from pysigner.mesosphere_signer import TellorSigner def run_signer(private_key): """ Starts mesosphere_signer.py with a provided private key """ cfg = get_configs(sys.argv[1:]) signer =...
workers.py
from multiprocessing import Process, Queue import multiprocessing import threading import time import uuid import ctypes import json import traceback import copy import sys import jimi class _threading(threading.Thread): def __init__(self, *args, **keywords): threading.Thread.__init__(self, *args, **keywo...
proxy.py
import socket import SocketServer import threading import select import sqlalchemy import time import errno from time import sleep import sys from sqlalchemy import create_engine, Table, Column, Index, Integer, String, ForeignKey from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION, TEXT, TIMESTAMP, BIGINT fr...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_axe.util import bfh, bh2u, UserCancelled from electrum_axe.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT) from electrum_axe import constants from electrum_axe.i18n ...
utility.py
import os import math import time import datetime from multiprocessing import Process from multiprocessing import Queue import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import imageio import torch import torch.optim as optim import torch.optim.lr_scheduler as lrs class ti...
multiprocess.py
import concurrent import math import threading from concurrent.futures import ThreadPoolExecutor from multiprocessing import Pool, cpu_count, Process import src.repository.global_params as global_params from src.library.logger import logger from src.library.shell import run_system_command_with_res class MultiProcess...
server.py
import socket import utils import threading TCP_IP, TCP_PORT = utils.request_socket_info() BUFFER_SIZE = 1024 MAX_CLIENT_COUNT = 5 SHOW_CODES = False print("Generating an RSA Scheme...") my_rsa = utils.RSA() public_key = my_rsa.public_key() print("IP: ", TCP_IP) print("Port: ", TCP_PORT) print("Public key: ", str(p...
linkcheck.py
""" sphinx.builders.linkcheck ~~~~~~~~~~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import json import queue import re import socket import threading from html.parser import HTMLP...
base_service.py
# -*- coding: utf-8 -*- """Custom Service implementation from MazeRunner.""" from __future__ import unicode_literals, absolute_import import os import sys import time import logging from threading import Thread from multiprocessing import Process import six import docker from attr import attrs, attrib from six.moves....
daemon.py
# System imports import os, sys # Adjust __file__ for Windows executable try: __file__ = os.path.abspath(__file__) except: __file__ = sys.executable sys.path.insert(0, os.path.dirname(__file__)) from intercom import * import intercom import typeworld.client class IntercomDelegate(intercom.IntercomDelegate): ...
decorators.py
#!/usr/bin/env python # encoding: utf-8 """""" from __future__ import division, print_function import base64 import hashlib import itertools as it import os import pickle import sys import traceback from functools import wraps from multiprocessing import Process, Queue from . import mkdir CACHEDIR = '.pycache' de...
observing.py
from multiprocessing import Process from panoptes.utils import error def on_enter(event_data): """Take an observation image. This state is responsible for taking the actual observation image. """ pocs = event_data.model current_obs = pocs.observatory.current_observation pocs.say(f"🔭🔭 I'm ...
new_gui_user.py
#!/usr/bin/env python3 import socket import os import ast from threading import Thread import random as r import time import datetime as dt import paho.mqtt.client as mqtt # import matplotlib.pyplot as plt from drawnow import * import subprocess as sp import config import smtplib import new_distribution as dst import ...
test_search.py
import multiprocessing import numbers import pytest from time import sleep from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.util_pymilvus import...
tester_cppk.py
#!/usr/bin/python3.6 # This script implements a regression testing the the REST API # It sends several requests in parallel threads to the TSP backend, checks responses and measures the execution timeouts # Designed by Nikita Novikov # Clover Group, Feb 21 2019 import json import time import glob import requests imp...
client.py
# Copyright 2019 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...
player.py
# -*- coding: utf-8 -*- import subprocess import threading import os import random import logging from os.path import expanduser from sys import platform, version_info, platform from sys import exit from time import sleep import collections import json import socket try: import psutil except: pass if platform.s...
bonjournal.py
import sys import os from datetime import date from datetime import datetime import glob import shutil from threading import Thread fg_colors = ["\033[30m","\033[31m","\033[32m","\033[33m","\033[34m","\033[35m","\033[36m","\033[37m"] fg_color = fg_colors[7]; bg_colors = ["\033[40m","\033[41m","\033[42m","\033[43m","\0...
waitingbar.py
import sys import threading import time from itertools import cycle class WaitingBar(object): ''' This class prints a fancy waiting bar with Greek chars and spins. It uses a thread to keep printing the bar while the main program runs Usage: THE_BAR = WaitingBar('Your Message Here') # Do somet...
Main.py
''' Main entry function for the overall python based server. This will load in individual pipe sub-servers and run their threads. Initial version just runs a test server. ''' ''' Note on security: Loading arbitrary python code can be unsafe. As a light protection, the pipe server will only load modules that ...
meter_device_gateway.py
''' ================================================================================================================================================================ meter_device_gateway.py ===================== Implements state management of and integration with a Meter Gateway, which is connected to the machine runn...
gui.py
# built-ins import csv import io import json import threading import time from collections import namedtuple, OrderedDict # third-party import tkinter as tk import selenium from tkinter import filedialog, messagebox, ttk # current package from formsgdownloader import formsg_driver from formsgdownloader.pyinstaller_ut...
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...
rotor_driver.py
#...........Drive a Servo motor with sin-wave PWM signal............ #Author: James Bramante #Date: May 3, 2017 from Adafruit_PWM_Servo_Driver import PWM import threading import time import math import numpy as np class RotorDriver(object): def __init__(self, channels = [0], magnitude = 0.5, period = 4., runtime...
e2e.py
from multiprocessing import Process from os import environ from time import sleep, time from pytest import fixture, raises import rethinkdb as r from selenium.webdriver import Chrome, Firefox, Remote from selenium.webdriver import ChromeOptions from selenium.webdriver import DesiredCapabilities from selenium.webdriver...
managers.py
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ] # # Imports # import sys import th...
proxy.py
# coding=utf-8 import socket import threading source_host = '127.0.0.1' source_port = 11210 desc_host = '0.0.0.0' desc_port = 11211 def send(sender, recver): while 1: try: data = sender.recv(2048) except: break print "recv error" try: recv...
test.py
import json import os.path as p import random import socket import threading import time import logging import io import string import ast import avro.schema import avro.io import avro.datafile from confluent_kafka.avro.cached_schema_registry_client import CachedSchemaRegistryClient from confluent_kafka.avro.serialize...
rnode.py
import re import os import queue import shlex import string import shutil import logging from logging import (Logger) import threading from threading import Event import contextlib from multiprocessing import Queue, Process from collections import defaultdict from typing import ( Dict, List, Tuple, Opti...
dokku-installer.py
#!/usr/bin/env python2.7 import cgi import json import os import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.5.4' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = subprocess.c...
rotaprint.py
#!/usr/bin/env python """ Copyright (c) 2020 This file is part of the rotaprint project. Main script for running rotaprint. Written by Callum Morrison <callum.morrison@mac.com> and Hélène Verhaeghe <hv236@bath.ac.uk>, 2020 Unauthorized copying of this file, via any medium is strictly prohibited Proprietary...
CVPlatform.py
import os import sys import threading import numpy as np import cv2 import huicui from PyQt5 import QtCore, QtGui from PyQt5.QtGui import * from PyQt5.QtWidgets import * from huicui import Image, Contour from huicui.lib import helper from huicui.operation import ImgOperation, ImgSample from helperPackage.affineTransf...
task.py
# Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # 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 # #...
test_urllib.py
"""Regresssion tests for urllib""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os try: import ssl except ImportError: ssl = None import sys import tempfile from nt...
oscsrv.py
import liblo import threading class OSCsrv(object): def __init__(self, port=1234, queue=None): self.server = None self.port = port self.queue = queue try: self.server = liblo.Server(self.port) self.isrunning = True except liblo.ServerError as err: ...
test_workflow_event_processor.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 u...
osc.py
import logging import os import threading from collections import OrderedDict from tempfile import mkstemp from time import sleep, time from uuid import uuid4 import rv.api import sunvox from pythonosc import osc_server, udp_client from pythonosc.osc_message_builder import OscMessageBuilder from sails.api import c fro...
test_change_stream.py
# Copyright 2017 MongoDB, 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, so...
test_key_cache_v2.py
import threading from time import sleep from typing import List, Callable import pytest from httpx import Response, HTTPStatusError from sap.xssec.key_tools import jwk_to_pem from tests.ias.ias_configs import JWKS, WELL_KNOWN from tests.ias.ias_tokens import PAYLOAD, HEADER def test_thread_safe_decorator(): sum...
impala_lite.py
# Copyright 2019 DeepMind Technologies 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.org/licenses/LICENSE-2.0 # # Unless required by ...
qt.py
from .tc_plugins import TCPlugin from .tools import TOS, HandlerTwoFactor from .tc_requests import tc_requests import os import sys import threading from functools import partial from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QHBoxLayout, QRadioButton, QCheckBox, QLineEd...
image_publisher_node.py
#!/usr/bin/env python from __future__ import print_function import roslib import sys import rospy import cv2 import os from std_msgs.msg import String from sensor_msgs.msg import Image from sensor_msgs.msg import CameraInfo from cv_bridge import CvBridge, CvBridgeError #from camera_calibration_parsers import readCalibr...
observer.py
import difflib import multiprocessing as mp import time import requests import ujson as json from artemis_utils import get_logger from artemis_utils.constants import CONFIGURATION_HOST from artemis_utils.envvars import REST_PORT from tornado.ioloop import IOLoop from tornado.web import Application from tornado.web imp...
geoprocessing.py
# coding=UTF-8 """A collection of raster and vector algorithms and utilities.""" import collections import functools import logging import math import os import pprint import queue import shutil import sys import tempfile import threading import time from . import geoprocessing_core from .geoprocessing_core import DEF...
thermometer.py
import os import time import threading SAMPLE_SIZE = 10 INTERVAL = 2 LOW_CUTOFF = -30.0 HI_CUTOFF = 600.0 ERR_VAL = -666 BASE_DIR = os.path.dirname(os.path.abspath(__file__)) class Thermometer: """ A base class for relevant thermometer functions for smokerpi """ def __init__(self, interval=INTERVAL):...
train_mask_rcnn_alt_opt.py
#!/usr/bin/env python # -------------------------------------------------------- # Mask R-CNN # Copyright (c) 2018 VitoChien # Licensed under The MIT License [see LICENSE for details] # Written by Ruihe Qian # -------------------------------------------------------- """Train a Mask R-CNN network using alternating opt...
main_12.py
import Redes.Red_Ini as Interface import Auxiliary.preprocessingData as Data import Auxiliary.GPUtil as GPU import os from threading import Thread import pickle import tensorflow as tf ################################### os.environ["CUDA_VISIBLE_DEVICES"] = "0, 1, 2" # To force tensorflow to only see one GPU. # Te...
__init__.py
""" objectstore package, abstraction for storing blobs of data for use in Galaxy, all providers ensure that data can be accessed on the filesystem for running tools """ import os import random import shutil import logging import threading from xml.etree import ElementTree from galaxy.util import umask_fix_perms, forc...
YT_Download.py
import os import re import eel import sys import time import ffmpeg import requests import threading import urllib.parse from pytube import YouTube from modules import meta_song from modules import lyrics class Downloader(): """docstring for Youtubehq""" def __init__(self, urls, mode): fix_urls = [] for url in ...
cell.py
import os import ssl import time import shutil import socket import asyncio import logging import argparse import datetime import functools import contextlib import multiprocessing import tornado.web as t_web import synapse.exc as s_exc import synapse.common as s_common import synapse.daemon as s_daemon import synap...
run.py
import time import threading from crawler import run as crawler_run from webapi import run as webapi_run from webapi import APIMiddleware from config import configger def watch_thread(): while True: try: google_storage_length = api_mdw.get_len('ggl') nongoogle_storage_length = api...
test_sys.py
import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support imp...
sender.py
"""Module for sending data and hosting sending servers.""" from aiohttp import web import asyncio import humanize from multiprocessing import Process import os import pkgutil import requests from requests_toolbelt import MultipartEncoder import socket from .exception import CodeExistsError, CodeNotFoundError, IsNot...
input.py
from riem.debug import Debug, DebugChannel from riem.library import ArrayList from threading import Event, Thread import enum, pygame class Action(enum.Enum): ACTION = 0 UP = 1 DOWN = 2 LEFT = 3 RIGHT = 4 class Controller: def __init__(self, app) -> None: # NOTE: app is Application type but partially initial...
scan_main.py
# -*- coding: utf-8 -*- # # Enteletaor - https://github.com/cr0hn/enteletaor # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this list of con...
generate.py
# Copyright (c) 2018, Kevin Spiteri # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and t...
ros2_facelook_node.py
# Copyright 2018 Robert Adams # # 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,...
manager.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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...
config.py
# ================================= # # --------------------------------- # # -- Dunkmania101's Qtile Config -- # # --------------------------------- # # ================================= # import os, subprocess, imaplib, re #, gi #gi.require_version("Gdk", "3.0") #from gi.repository import Gdk from json import loads...
chat.py
#Comando python chat.py 8000 http://192.168.0.2:8001 #Cor para o grid, mesma do fundo do atom(40,44,52) from bottle import run, get, post, view, redirect, request import requests, bottle, json, threading, time, sys import pygame #Variaveis Globais que precisa ser acessadas em várias threads myGlobalList = [] flagCl...
dbench.py
#!/usr/bin/env python import os import sys import pdb ROOT = os.path.dirname( os.path.dirname( os.path.abspath(__file__))) sys.path.append(ROOT) from dynomite import Client from optparse import OptionParser from threading import Thread from Queue import Queue from time import time from random import choice...
bridgeClient.py
#! /usr/bin/python import socket import threading from time import sleep import sys, os import inputbox import pygame from bridgeSprites import Button class userInterfaceWindow(): def __init__(self, screen): self.screen = screen self.clients = [] self.userName = inputbox.ask(screen, "Type your name ") ...
multi.py
import multiprocessing import logging import os import shutil import time import typing from nbcollection.ci.scanner.utils import find_build_jobs, generate_job_context, run_job_context from nbcollection.ci.constants import SCANNER_BUILD_LOG_DIR logger = logging.getLogger(__name__) def build_artifacts_concurrently(o...
common.py
# Copyright 2021 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 enum import Enum from functools import wraps from pathlib import...
test_writer.py
import os import socket import tempfile import threading import time import mock import msgpack import pytest from six.moves import BaseHTTPServer from six.moves import socketserver from ddtrace.constants import KEEP_SPANS_RATE_KEY from ddtrace.internal.compat import PY3 from ddtrace.internal.compat import get_connec...
pydoc.py
#!/usr/bin/env python # -*- coding: latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
zhihu.py
#!/usr/bin/env python # encoding: utf-8 """ @version: 1.0 @author: lizheming @contact: nkdudu@126.com @site: lizheming.top @file: zhihu.py """ from login import islogin, login #from logo import logo import requests import cookielib from bs4 import BeautifulSoup import re import os import json import termcolor import ...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue 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 subprocess import struct import operator import p...
debug_data_multiplexer.py
# Copyright 2019 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...
HardwareThread.py
# -*- coding: utf-8 -*- # # Singleton Thread class to control the alarm alert hardware # # Copyright (c) 2015 carlosperate http://carlosperate.github.io # # Licensed under The MIT License (MIT), a copy can be found in the LICENSE file # from __future__ import (unicode_literals, absolute_import, print_function, divi...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
main.py
# -*- coding: utf-8 -*- import tensorflow as tf import threading import numpy as np import signal import random import math import os import time from model import SomaticSimpleNetwork, SomaticRecurrentNetwork from model import create_model from trainer import Trainer from rmsprop_applier import RMSPropApplier from c...
handler.py
import multiprocessing import time import requests import engine import common from engine import CHECK, BE_MODIFIED, DOWNLOAD_UPLOAD, TO_MODIFY, UPLOAD, urls, url_status, url_status_base from engine.downloader import download, Extractor from engine.upload import Upload from common import logger from common.event impor...
test_examples.py
import itertools import multiprocessing import runpy import sys from os import path as osp import pytest def run_main(*args): # patch sys.args sys.argv = list(args) target = args[0] # run_path has one difference with invoking Python from command-line: # if the target is a file (rather than a dire...
simple_watchtower.py
from werkzeug.wrappers import Request, Response from werkzeug.serving import run_simple from threading import Thread, Lock from time import sleep import requests import argparse import json from jsonrpc import JSONRPCResponseManager, dispatcher notification_dict = {} ntf_service = None verbose = 0 counter = 1 lock =...
main.py
import argparse from loguru import logger import multiprocessing as mp import sys import numpy as np import recorder from evaluator import Evaluator from user.user_factory import UserFactory q = mp.Queue() ################################## # uncomment the following to run # ################################## # ToPS...
datasets.py
import glob import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from t...
main.py
# Copyright (c) 2020, NVIDIA CORPORATION. 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...
test_dialect_detection.py
# -*- coding: utf-8 -*- """ Integration tests for dialect detection. Author: G.J.J. van den Burg """ import argparse import chardet import clevercsv import gzip import json import multiprocessing import os import termcolor import time import warnings THIS_DIR = os.path.abspath(os.path.dirname(__file__)) SOURCE_DIR...
tieba_sync.py
#!/usr/bin/env python3 import sys import socket import threading from time import sleep from fetch import fetch_kw from tieba_transport import move from models import TiebaTopic from config import ( TIEBA_SYNC_ON, TIEBA_SYNC_KW, TIEBA_SYNC_INTERVAL, TIEBA_SYNC_DELAY, TIEBA_SYNC_PENDING_MAX, TIEBA_SYNC_OFFSET ...
statusprocess.py
try: import thread except ImportError: import threading import functools import time import sublime class StatusProcess(object): def __init__(self, msg, listener): self.msg = msg self.listener = listener myThread = threading.Thread(target=self.run_thread) myThread.start() ...
test_utils.py
# Copyright 2019 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, ...
stop_gce_instances.py
#!/usr/bin/env python import argparse parser = argparse.ArgumentParser() parser.add_argument("--pat") parser.add_argument("--instances",nargs="+") args = parser.parse_args() from control4.cloud.cloud_interface import load_cloud_config,create_cloud from threading import Thread cloud_config = load_cloud_config(provider...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threa...
websocketconnection.py
import threading import websocket import gzip import ssl import logging from urllib import parse import urllib.parse from binance_d.base.printtime import PrintDate from binance_d.impl.utils.timeservice import get_current_timestamp from binance_d.impl.utils.urlparamsbuilder import UrlParamsBuilder from binan...
test_eap_proto.py
# EAP protocol tests # Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import binascii import hashlib import hmac import logging logger = logging.getLogger() import os import select import struct import threading i...
simpleSSHFuzzer.py
from pexpect import pxssh import threading import time import os import sys def bruter(host,username,password): s = pxssh.pxssh() try: #print username s.login(host,username,password, login_timeout=500) except Exception as e: print(e) #time.sleep() #os._exit(1) prin...
ait_bsc.py
#!/usr/bin/env python # Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT) # Bespoke Link to Instruments and Small Satellites (BLISS) # # Copyright 2016, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any # commercial use must...
uniGridDistribution.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # import sys import time import logging import getopt from multiprocessing import Process from util.preprocess import mergeMatrixs from util.preprocess import mergeSmallRecords from util.UniGridDisBasic import UniGridDisBasic def processTask(x, city, directory, inum,...
Interface.py
import socket import struct import threading import netifaces import ipaddress import traceback from fcntl import ioctl from abc import ABCMeta, abstractmethod SIOCGIFMTU = 0x8921 class Interface(metaclass=ABCMeta): MCAST_GRP = '224.0.0.13' def __init__(self, interface_name, recv_socket, send_socket, vif_in...
111.py
##liuhuihui 1-5 plan ###see https://blog.csdn.net/typing_yes_no/article/details/51758938 ''' WebSocketApp是websocket的一个类 封装了websocket里面的connect、send消息等函数,更方便于调用 ''' import websocket import json import redis import threading import threadpool pool = redis.ConnectionPool(host='127.0.0.1', port=6379, decode_re...
demoAll-prg-multi.py
"Launching GUIs as programs other ways: multiprocessing" """ 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 ...
crestprocessor.py
# crestprocessor.py import threading from PyQt5 import QtCore from .crest.crest import Crest class CrestProcessor(QtCore.QObject): """ CREST Middle-ware """ login_response = QtCore.pyqtSignal(str) logout_response = QtCore.pyqtSignal() location_response = QtCore.pyqtSignal(str) destination...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue 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 subprocess import struct import operator import p...