source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
broker_launcher.py | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... |
HybridPhotonicsCLSim.py | #!/usr/bin/env python
import os
import subprocess
import threading
import time
import logging
from os.path import expandvars
from icecube import icetray, dataclasses
import math
def taskset(pid,tt=None):
# get/set the taskset affinity for pid
# uses a binary number string for the core affinity
l = ['/bin... |
blockchain_processor.py | #!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# 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, ... |
app.py | #############################################################################
# Copyright (c) 2018, Voila Contributors #
# Copyright (c) 2018, QuantStack #
# #
# Distri... |
test_socket.py | import unittest
import os
from py_compile import compile
import sys
import random
import threading
import warnings
import os
import port_for as pf
from socket import socket as _socket_
startup_lock = threading.Lock()
TRAVIS = 'CI' in os.environ
def make_random_string():
return "".join(chr(random.randint(0,255)) f... |
server.py | #!/usr/bin/env python3.8
from os import (
path,
R_OK,
W_OK,
access,
chmod,
chown,
remove,
stat,
environ,
chdir
)
from socketserver import (
TCPServer as TCPSocketServer,
UnixStreamServer,
BaseRequestHandler
)
from pwd import getpwnam
from stat import S_ISSOCK
from log... |
simulator.py | import math
import msgpackrpc
import pygame
import random
import sys
import socket
import time
import threading
from math import cos, sin, pi, sqrt, atan2
from pygame.locals import *
screen_size_x = 1920
screen_size_y = 1080
DIST_PER_TICK = 1
d2r = pi/180
# https://gist.github.com/xaedes/974535e71009fa8f090e
class... |
asyncf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of pam-device
#
# Copyright (c) 2019 Lorenzo Carbonell Cerezo <atareao@atareao.es>
#
# 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 th... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob, make_dir
# See https://en.wikipedia.org/w... |
mtMoko.py | import re
import os
import urllib3
import threading
import time
import queue
baseUrl = "http://www.moko.cc/mtb/model/%d/space.html"
imgPat = re.compile(r'http://img\S*?\.(?:jpg|jpeg|png)')
namePat = re.compile(r'<div class="username".*?<a>(.*)</a>')
shoePat = re.compile(r'<li><span>鞋码</span><b>/</b><input type="text" ... |
elasticArchive.py | """
This script serializes the entire traffic dump, including websocket traffic,
as JSON, and either sends it to an elasticsearch endpoint for permenant storage.
Unlike some plugins, this one sends all requests and responses to elasticsearch
in real-time.
This script is based on the original mitmproxy scripts jsondum... |
datacollector.py | from multiprocessing import Process, Queue
def get_dates(queue, start_date='2010/07/17', end_date='2023/01/07'):
from bs4 import BeautifulSoup #module for web scraping install by pip install beautifulsoup4
import requests #for requesting html. install by pip install requests
from requests.adapters import HTTPAdapte... |
multip.py | from multiprocessing import Process, Queue
import os, time, random
def write(q):
for value in ['A', 'B', 'C']:
print 'Put %s to queue...' % value
q.put(value)
time.sleep(random.random())
def read(q):
while True:
value = q.get(True)
print 'Get %s from queue.' % value
if... |
uvdata.py | # -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Primary container for radio interferometer datasets."""
import os
import copy
from collections.abc import Iterable
import warnings
import threading
import numpy as np
from scipy impor... |
main.py | from transformers import pipeline, AutoTokenizer, AutoModelForMaskedLM
from flask import Flask, request, jsonify, render_template
import torch
from queue import Queue, Empty
from threading import Thread
import time
app = Flask(__name__)
print("model loading...")
device = torch.device('cuda' if torch.cuda.is_availab... |
backlight.py | from threading import Thread, Event
from time import sleep
from datetime import datetime
def activate_backlight_wrapper(func):
def wrapper(self, *args, **kwargs):
self.enable_backlight()
self._backlight_active.set()
result = func(self, *args, **kwargs)
if self._backlight_interval an... |
entry2.py | import cv2
from defer import return_value
import numpy as np
import re
import os
import easyocr
import tkinter as tk
import time
from tkinter import *
from numpy import array
from cv2 import line
import RPi.GPIO as GPIO
import threading
import sys
import pymysql
from datetime import datetime
##take photo
os.system("p... |
object_detector.py | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Class definition and utilities for the object detection toolkit.
"""
from __futu... |
sensor.py | #!/usr/bin/env python2
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function # Requires: Python >= 2.6
import sys
sys.dont_write_bytecode = True
import core.versioncheck
import inspect
import... |
mp_preload.py | import multiprocessing
multiprocessing.Lock()
def f():
print "ok"
if __name__ == "__main__":
ctx = multiprocessing.get_context("forkserver")
modname = "test.mp_preload"
# Make sure it's importable
__import__(modname)
ctx.set_forkserver_preload([modname])
proc = ctx.Process(target=f)
... |
Device.py | import io
import threading
from multiprocessing import Queue
import numpy as np
from abc import abstractmethod
import time
import psutil
from PyQt5.QtCore import QObject, pyqtSignal
from urh.util.Formatter import Formatter
from urh.util.Logger import logger
class Device(QObject):
BYTES_PER_SAMPLE = None
rc... |
Binance Detect Moonings.py | """
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repositoy should be
construed as investment advice.Any reference to an investment's past or
potential performance is not, and should not be construed as, a recommendation
or as a guarantee... |
script-coinbasepro-webhooks.py | import json, time
from threading import Thread
from websocket import create_connection, WebSocketConnectionClosedException
def main():
ws = None
thread = None
thread_running = False
thread_keepalive = None
def websocket_thread():
global ws
ws = create_connection("wss://ws-feed.pr... |
monitor.py | # Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
tools.py | # Lint-as: python3
"""Utilities for locating and invoking compiler tools."""
# Copyright 2020 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
#
# https://www.apache.org/licen... |
__init__.py | import inspect
import multiprocessing
import re
import tempfile
import time
from abc import ABC, abstractmethod
from contextlib import ContextDecorator, contextmanager
from typing import Callable, Dict, List, Optional, Type
import yaml
from ergo.ergo_cli import ErgoCli
class ComponentInstance:
def __init__(self... |
predict_multithreaded.py | import os
import numpy as np
import tensorflow as tf
import pandas as pd
from datasets import generate_filenames
from keras.applications.imagenet_utils import preprocess_input
from keras.preprocessing.image import array_to_img, load_img, img_to_array, flip_axis
from tensorflow.python.client import device_lib
from mod... |
simpleclient.py | import bluetooth
import threading
import re
def sendData():
while True:
data = input("Send: ")
sock.send(data)
def receiveData():
while True:
data: bytes = sock.recv(4096)
#data_format = re.sub('1?..', lambda m: chr(int(m.group())), data.decode("ascii"))
print("Received... |
main.py | import paho.mqtt.client as paho
import psutil
import signal
import sys
import time
from threading import Thread
DeviceID = 0
def functionDataActuator(status):
print "Data Actuator Status %s" % status
def functionDataActuatorMqttOnMessage(mosq, obj, msg):
print "Data Sensor Mqtt Subscribe Message!"
funct... |
hotword_factory.py | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
runner.py | # from __future__ import absolute_import
import threading
from time import sleep
import os
import sys
# import signal
from daemonize import Daemonize
import ipdb
from alpha_tech_tracker.alpaca_engine import DataAggregator
from alpha_tech_tracker.strategy import SimpleStrategy
from alpha_tech_tracker.nvda_strategy ... |
define_thread.py | import threading
def func(i):
print("func called by thread" + str(i))
thread_list = []
for i in range(20):
t = threading.Thread(target=func,args=(i,))
thread_list.append(t)
t.start()
t.join()
|
image_agent.py | #Entry point for the LEC agent
#Script has anomaly detectors, assurance monitors and risk computations
import os
import cv2
import torch
import torchvision
import carla
import csv
import math
import pathlib
import datetime
import gc
import time
from numba import cuda
from PIL import Image, ImageDraw,ImageFont
import th... |
server.py | import os
import queue
import subprocess
import sys
import threading
import time
from concurrent.futures import ThreadPoolExecutor
import grpc
from dagster import check, seven
from dagster.core.code_pointer import CodePointer
from dagster.core.definitions.reconstructable import (
ReconstructableRepository,
re... |
Runner.py | import tensorflow as tf
import threading
import numpy as np
import ray
import os
from warehouse_env import WarehouseEnv
import random
from Ray_ACNet import ACNet
import GroupLock
from Worker import Worker
import scipy.signal as signal
from parameters import *
class Runner(object):
"""Actor object to start run... |
video_valid_check.py | import os
import decord as de
from multiprocessing import Process
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
def scale_videos(vids, i):
with open("loveu_invalid_" + str(i) + ".txt", "w") as fw:
for vid in vids:
... |
wrapper.py | #!/usr/bin/env python
"""
@package mi.core.instrument.wrapper
@file mi/core/instrument/wrapper.py
@author Peter Cable
@brief Driver process using ZMQ messaging.
Usage:
run_driver <module> <driver_class> <refdes> <event_url> <particle_url>
Options:
-h, --help Show this screen.
"""
import consulate
im... |
test_advanced.py | # coding: utf-8
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import random
import sys
import threading
import time
import numpy as np
import pytest
import ray
import ray.cluster_utils
import ray.test_utils
from ray.test_utils import RayTestTimeoutException
logger = logging.getLogger(... |
d12.py | # -*- coding: utf-8 -*-
from linepy import *
from akad.ttypes import Message
from akad.ttypes import ContentType as Type
from akad.ttypes import ChatRoomAnnouncementContents
from akad.ttypes import ChatRoomAnnouncement
from multiprocessing import Pool, Process
from datetime import datetime
from time import sleep
from b... |
__init__.py | #-*- coding: utf-8 -*-
"""
choco.py - An KakaoTalk Bot
Copyright 2014, ssut
Licensed under the MIT License.
Do you like chocopy? :)
"""
import time
import os
import sys
import traceback
import base64
import json
import redis
import socket
import curses
from ctypes import c_int, c_bool
from threading import Thread
fro... |
test_websocket.py | import asyncio
import functools
import threading
import time
from contextlib import contextmanager
import pytest
import requests
from uvicorn.config import Config
from uvicorn.main import ServerState
from uvicorn.protocols.http.h11_impl import H11Protocol
from uvicorn.protocols.websockets.wsproto_impl import WSProtoc... |
config_asa.py | #!/usr/bin/env python3
# scripts/config_asa.py
#
# Import/Export script for vIOS.
#
# @author Andrea Dainese <andrea.dainese@gmail.com>
# @copyright 2014-2016 Andrea Dainese
# @license BSD-3-Clause https://github.com/dainok/unetlab/blob/master/LICENSE
# @link http://www.unetlab.com/
# @version 20160719
import getopt,... |
multi_camera_multi_target_tracking_demo.py | #!/usr/bin/env python3
"""
Copyright (c) 2019-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... |
ioloop_test.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import contextlib
import datetime
import functools
import socket
import sys
import threading
import time
from tornado import gen
from tornado.ioloop import IOLoop, TimeoutError
from tornado.log import app_log
from ... |
server.py | #!/usr/bin/env python3
import argparse
import signal
import socket
import sys
import threading
class Server:
'''
Server is the passive side of client-server architecture model. It binds
to one or more local interface and listens for incoming connection on some
port.
For learning purporses, all i... |
application.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
mgms.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# mgms.py
# Main module for GUI front-end
# Sadie Gladden <gladdesm@mail.uc.edu>
# Eric Krenz <krenzew@mail.uc.edu>
import time
import traceback
import threading
from pathlib import Path
import matplotlib.pyplot as plt
import serial
import PySimpleGUI as sg
RADIO_LI... |
ch06_listing_source.py |
import bisect
from collections import defaultdict, deque
import json
import math
import os
import time
import unittest
import uuid
import zlib
import redis_x
QUIT = False
pipe = inv = item = buyer = seller = inventory = None
# <start id="_1314_14473_8380"/>
def add_update_contact(conn, user, contact):
ac_list =... |
contest.py | #!/usr/bin/env python
import xmlrpclib, SimpleXMLRPCServer, threading
#############
# Handle the callbacks here:
callback_handler = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 20001))
def print_event(event_type, args, state):
print "type: %s\nargs: %s\n state: %s\n\n" % (event_type, args, state)
return T... |
websocket.py | import asyncio
import os
import signal
import threading
try:
import websockets
except (ImportError, SyntaxError):
# websockets 3.10 on python 3.6 causes SyntaxError
# See https://github.com/yt-dlp/yt-dlp/issues/2633
has_websockets = False
else:
has_websockets = True
from .common import FileDownloa... |
io_utils.py | import os
import requests
import shutil
from pathlib import Path
from queue import Queue
from threading import Thread
from PIL import Image
from io import BytesIO
import boto3
import cv2
import numpy as np
def download_image_and_save(image_url, destination):
"""Downloads an image stored remotely and saves it loc... |
client.py | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# pylint: d... |
views.py | from django.conf import settings
from django.contrib.auth import logout as logout_func
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
from django.contrib import messages, auth
from django.contrib.auth.models import User
from django.urls import reverse
from accounts.models imp... |
Processor.py | from MusEEG import eegData, client, classifier, cerebro
from audiolazy.lazy_midi import str2midi
from MusEEG import parentDir
import os
import numpy as np
import threading
from osc4py3.as_eventloop import *
from osc4py3 import oscbuildparse
import pandas as pd
import queue
import pickle
import time
class Processor:
... |
controller.py | #!/usr/bin/env python
import pprint
import traceback
import sys
import time
import random
import requests
import json
import os
from operator import itemgetter
from threading import Lock
from threading import Thread
from pymemcache.client.base import Client
from pymemcache.client import MemcacheUnknownError
from timeit... |
host.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 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 json
import logging
import datetime
from django.db import models
from django.db import transaction
from django.db import IntegrityError
f... |
meta.py | import json
import os
import sys
import platform
import multiprocessing
import pynvml
import threading
import signal
import time
import socket
import getpass
import logging
from shutil import copyfile
from datetime import datetime
from wandb import util
from wandb import env
import wandb
METADATA_FNAME = 'wandb-metad... |
serve.py | # Most of this code is:
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# The server command includes the additional header:
# For discussion of daemonizing:
# http://aspn.activestate.com/ASPN/C... |
build.py | ## @file
# build a platform or a module
#
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD Li... |
ex01.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
"""
普通版本测试:
- 多线程, 并没有非多线程版本快, 受限于 GIL 影响.
"""
# 性能分析装饰器:
def profile(func):
def wrapper(*args, **kwargs):
import time
start_at = time.time()
func(*args, **kwargs)
end_at = time.time()
print("<Cost: {}... |
pi_train.py | """Simulate the shutdown sequence on the train pi."""
import socket
import threading
import time
def talk_to_master(startShutdown, shutdownComplete):
with socket.socket() as sock:
sock.bind(('', 31337))
sock.listen()
conn, _ = sock.accept()
print('master pi has asked us ... |
python_threads_test.py | import mock
import pytest
from tests.test_helpers import TracingThread
@mock.patch("tests.test_helpers.threading.Thread.start")
@mock.patch("tests.test_helpers.threading.Thread.run")
@mock.patch("py_zipkin.instrumentations.python_threads.storage.set_default_tracer")
@mock.patch("py_zipkin.instrumentations.python_thr... |
test.py | import unittest
from random import randint, choice
from string import lowercase
import threading
import time
f = open("/dev/ccpkp", "r+", 10)
@unittest.skip("Skipping correctness")
class TestCorrectness(unittest.TestCase):
def test_single_write(self):
s = "testing a single write"
f.write(s)
... |
publisher.py | import errno
import hashlib
import os
import posixpath
import select
import shutil
import subprocess
import tempfile
import threading
from contextlib import contextmanager
from werkzeug import urls
from lektor._compat import (iteritems, iterkeys, range_type, string_types,
text_type, queue, StringIO)
from lektor.e... |
save_context_test.py | # Copyright 2020 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... |
test_stream.py | # Copyright © 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# # Stream Acceptance Test
# This test checks if the event stream works correctly. The basic idea of this
# test is... |
iperf_wrapper.py | import os
import shlex
import argparse
import datetime
import subprocess
from typing import IO
from io import TextIOWrapper
from threading import Thread
from balancer_routine import balancer_routine
from balancer_routine import env_data
class Iperf_wrapper():
def __init__(self, parameters: str = "-s -u", verbos... |
c_core.py | import os, sys, signal, time, timeit
import cv2
import numpy as np
from threading import Thread
from queue import Queue
#from Queue import Queue
from c_camera import ImgCap, initCamera
import copy
np.set_printoptions(threshold=sys.maxsize)
class iTask(Thread):
def __init__(self, queue, signal):
Thread.__i... |
HASH160_randomCPU.py | '''
Made by Mizogg Look for HASH160 Compressed and Uncompressed Using iceland2k14 secp256k1 https://github.com/iceland2k14/secp256k1 fastest Python Libary
Good Luck and Happy Hunting HASH160_randomCPU.py Version 2 scan randomly in Range with CPU Speed Improvments
https://mizogg.co.uk
'''
import secp256k1 a... |
setupDB.py | """
Author: Ben Podrazhansky
This script reloads the database by creating a separate database for each table in parallel then attaches them to a
single database. Next the data is preprocessed. At the time or writing, the data is preprocessed by standardization.
"""
try:
from Data import REAL_COLUMNS
except:
R... |
test_operator_gpu.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... |
android.py | #-*- encoding: utf-8 -*-
import bisect
import cv2
import os
import threading
import time
from atx.drivers import Bounds
from atx.drivers.android import AndroidDevice
from atx.adbkit.mixins import RotationWatcherMixin, MinicapStreamMixin
from atx.record.base import BaseRecorder, ScreenAddon, UixmlAddon
f... |
test_server.py | from __future__ import unicode_literals
import os.path
import threading
import time
from future.builtins import str
import zmq
from zmq.eventloop import ioloop, zmqstream
import tornado.testing
ioloop.install()
def test_server_creation():
from pseud import Server
user_id = b'echo'
server = Server(user_... |
qt.py | #!/usr/bin/env python3
#
# Electron Cash - a lightweight Bitcoin Cash client
# CashFusion - an advanced coin anonymizer
#
# Copyright (C) 2020 Mark B. Lundeberg
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to d... |
ProjE_sigmoid.py | import argparse
import math
import os.path
import timeit
from multiprocessing import JoinableQueue, Queue, Process
import numpy as np
import tensorflow as tf
class ProjE:
@property
def n_entity(self):
return self.__n_entity
@property
def n_train(self):
return self.__train_triple.shap... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electroncash.bitcoin import TYPE_ADDRESS
from electroncash import WalletStorage, Wallet
from electroncash_gui.kivy.i18n import _
from electroncash.paymentrequest import InvoiceStore
from electr... |
Main.py | from PyQt5 import QtWidgets, uic
import sys
from bs4 import BeautifulSoup
import requests
import threading
from pynotifier import Notification
from MainUI import MainUI
import mysql.connector
def Price():
try:
cursor.execute('SHOW TABLES')
product_data = cursor.fetchall()
product_... |
inter_night_associations.py | import numpy as np
import pandas as pd
import multiprocessing as mp
import os
import astropy.units as u
import time as t
from collections import Counter
from fink_fat.associations.intra_night_association import intra_night_association
from fink_fat.associations.intra_night_association import new_trajectory_id_assignati... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the lic... |
ws.py | import websocket
import threading
import logging
import time
import hmac
from urllib.parse import urlparse, urlunparse
import hashlib
from time import sleep
import json
import traceback
class Exchange_WebSocket(object):
MAX_TABLE_LEN = 200
def __init__(self, exchangeName, key, secret, loggerObject = None, *a... |
indexes.py | import datetime
import Queue
from threading import Thread
import time
from django.test import TestCase
from haystack.indexes import *
from core.models import MockModel, AThirdMockModel
from core.tests.mocks import MockSearchBackend
class BadSearchIndex1(SearchIndex):
author = CharField(model_attr='author')
pu... |
Send_Keys.py | '''
Test which will capture select keyboard key presses, and will
signal them to x4 accordingly, to be bound x4-side to MD cues.
Uses the pynput package (not included with anaconda or standard python).
'''
'''
Keyboard capture example here:
https://pynput.readthedocs.io/en/latest/keyboard.html
This Listener appears... |
events.py | import threading
import time
def myThread(myEvent):
while not myEvent.is_set():
print("Waiting for Event to be set")
time.sleep(1)
print("myEvent has been set")
def main():
myEvent = threading.Event()
thread1 = threading.Thread(target=myThread, args=(myEvent,))
thread1.start()
time.sleep(10)
my... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
t.py | from HTTPServer import *#include U
# U.pln(dir())
@route()
def a(h):
U.pln(dir())
return [1,2,3]
def main():
from threading import Thread
Thread(target=serve).start()
# serve()
if __name__=='__main__':
main()
|
net.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import time
import struct
import socket
import threading
gBufSize = 1024
"""
接口有两个函数
1. 构造
2, Read
"""
class FCUdp():
def __init__(self, ip, port):
super(FCUdp, self).__init__()
self.mIp = ip
self.mPort = port
self.mTargetA... |
docker_base.py | import json
import logging
import os
import threading
from multiprocessing import Process, Queue
from queue import Empty
from typing import Tuple, Union
from docker import DockerClient
from docker.models.containers import Container
from casperlabs_local_net.errors import CommandTimeoutError, NonZeroExitCodeError
from ... |
real_time_pos_car.py | from os import read
import queue
from codetiming import Timer
import asyncio
import matplotlib.pyplot as plt
import numpy as np
import sys
import random
from itertools import count
import time
from matplotlib.animation import FuncAnimation
from numpy.core.numeric import True_
import matplotlib
import queue
import async... |
cache.py | #!/usr/bin/env python3
from functools import wraps
import threading
from datetime import datetime
from datetime import timedelta
import time
import queue
import copy
import logging
logger = logging.getLogger(__name__)
# decorator (with different TTL for each function)
# No removal of entries (designed for small numb... |
asyncorereactor.py | # Copyright DataStax, 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, softwa... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum_dongri import Wallet, WalletStorage
from electrum_dongri.util import UserCancelled, InvalidPassword
from electrum_dongri.base_wizard import BaseWizard, HWD_SETUP_DEC... |
DialogPluginManager.py | '''
Created on March 1, 2012
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
based on pull request 4
'''
from tkinter import Toplevel, font, messagebox, VERTICAL, HORIZONTAL, N, S, E, W
from tkinter.constants import DISABLED, ACTIVE
try:
from tkinter.ttk import Tre... |
winnie.py | #!/usr/bin/env python3
"""
Generates articles in the style of the CCP's hilarious Global Times website.
"""
import sys, os, re, lzma, statistics, random, math, json
from argparse import ArgumentParser
from itertools import count
from queue import Queue
from threading import Thread
# For pulling apart their stupid web... |
inference_request.py | import grpc
import time
import json
import sys
import uuid
from arch.api.proto import inference_service_pb2
from arch.api.proto import inference_service_pb2_grpc
import threading
def run(address):
ths = []
with grpc.insecure_channel(address) as channel:
for i in range(1):
th = threading.T... |
eval_coco_format.py | # Lint as: python2, python3
# 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-... |
serialtube.py | import sys
import time
import serial
from . import tube
from .. import context
from .. import term
from ..log import getLogger
log = getLogger(__name__)
class serialtube(tube.tube):
def __init__(
self, port = '/dev/ttyUSB0', baudrate = 115200,
convert_newlines = True,
bytesiz... |
pipeline.py | #!/usr/bin/env python
import coloredlogs
import ConfigParser
import json
import numpy as np
import socket
import struct
import time
import shlex
from subprocess import PIPE, Popen, check_output
from inspect import currentframe, getframeinfo
from astropy.time import Time
import astropy.units as units
import logging
fro... |
server_gui.py | import json
import threading
import traceback
import zmq
import mayaserver
from maya.utils import executeInMainThreadWithResult
def runserver(handshake_port):
threading.Thread(
target=_runserver, args=[handshake_port]).start()
def _eval(s):
return eval(s, globals(), globals())
def _exec(s):
exec... |
starter.py | import threading
from service_to_server import service as service
from service_worker.src import worker
if __name__ == '__main__':
thread2 = threading.Thread(target=service.run)
thread3 = threading.Thread(target=worker.run)
thread2.start()
thread3.start()
|
test_event.py | import asyncio
import threading
import unittest
from evently import (
ALL_EVENTS,
Event,
Evently,
EventHandler,
run_callback_threadsafe
)
TEST_EVENT = "test_event"
TEST_EVENT_2 = "test_event_2"
TEST_EVENT_3 = "test_event_3"
def get_event_evently():
loop = asyncio.new_event_loop()
stop_ev... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.