source
stringlengths
3
86
python
stringlengths
75
1.04M
server.py
# -*- coding: utf-8 -*- import json from threading import Thread from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class JsonHandler(BaseHTTPRequestHandler): def _set_headers(self): self.send_response(200) self.send_header('Content-type', 'application/json') self.end_headers()...
via65c02.py
import sys import time import threading from utils import console class VIA(): SR = 4 SET_CLEAR = 128 def __init__(self, start_addr, mpu): self.mpu = mpu self.VIA_SR = start_addr + 0x0a # shift register self.VIA_IFR = start_addr + 0x0d # interrupt flags register self...
consoleControl.py
#!/usr/bin/python import socket import numpy as np import sys import signal import time import threading from threading import Thread import curses from curses import wrapper from curses import ascii """ @brief Keyboard control for the QuickBot. @description This program is used to drive the QuickBot via the keyboar...
gui2.py
import gi import smbus2 import CSPB import os.path import time import threading import queue from datetime import datetime gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GLib, Gdk class gui2: """ A class to generate a graphical user interface and provide i2c communications with the clu...
unzip.py
# _*_coding:utf8- import zipfile import optparse from threading import Thread def extractFile(zFile,password): ''' :param zFile: it's function in Python :param password: password in password.txt,and try use it to extract with zip file :return: None ''' try: zFile.extractall(pwd=pass...
behavior.py
from itertools import izip from threading import Thread, Lock import time import math from enum import Enum from localization import RobotPose from camera_geometry import CamGeom from threadsafe import ThreadSafe from walker import Walker, OdoListener class Stance(Enum): FACE_DOWN = 0 FACE_UP = 1 RIGHT...
Analysis.py
""" This module contains the ``analysis`` class. It includes common classes for file management and messaging and all calls to AEDT modules like the modeler, mesh, postprocessing, and setup. """ from __future__ import absolute_import import os import shutil import threading import warnings from collections import Ord...
read_translator.py
#!/usr/bin/env python3 import Bio, sys, multiprocessing, subprocess from multiprocessing import Process from Bio import SeqIO from datetime import datetime startTime = datetime.now() fastq = "$fastq" def write_record(record_id, orfseq, output_file, translation_num, orientation): """ This function writes a ...
kafka_host.py
# -*- UTF-8 -*- import os import tornado from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado.web import Application, RequestHandler from typing import Optional, Awaitable from programmingalpha import AlphaConfig, AlphaPathLookUp from programmingalpha.alphaservices.KafkaMPI.kafka_no...
3words_run.py
import argparse import boto3 from git import Repo from git import Git import threading import os import pixray import json from transformers import GPT2LMHeadModel, GPT2TokenizerFast from sh import git import numpy as np device = 'cuda' model_id = 'gpt2' def perplexity(prompt): model = GPT2LMHeadModel.from_pretra...
BaseSpider.py
import datetime import requests from src.threadPool.ImageThreadPool import ImageThreadPool from src.util import util from copy import deepcopy import json from src.util.constant import BASE_DIR, EXPIRE_TIME_IN_SECONDS, BASE_PATH, QR_CODE_MAP_KEY import re import logging from src.web.entity.UserInfo import UserInfo fr...
run_superglue.py
# coding=utf-8 # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # # All the modifications on top of # https://github.com/W4ngatang/transformers/blob/superglue/examples/run_superglue.py # are under the MIT license by Microsoft. # # Copyright 2018 The Google AI Language Team Authors and The Hugg...
test_session.py
import os localDir = os.path.dirname(__file__) import sys import threading import time import cherrypy from cherrypy._cpcompat import copykeys, HTTPConnection, HTTPSConnection from cherrypy.lib import sessions from cherrypy.lib.httputil import response_codes def http_methods_allowed(methods=['GET', 'HEAD']): meth...
hashdump_sam.py
import core.implant class HashDumpSAMImplant(core.implant.Implant): NAME = "SAM Hash Dump" DESCRIPTION = "Dumps the SAM hive off the target system." AUTHORS = ["zerosum0x0"] def load(self): self.options.register("LPATH", "/tmp/", "local file save path") self.options.register("RPATH", ...
test_threading.py
# -*- coding: utf-8 -*- """ Tests for thread usage in lxml.etree. """ import unittest, threading, sys, os.path this_dir = os.path.dirname(__file__) if this_dir not in sys.path: sys.path.insert(0, this_dir) # needed for Py3 from common_imports import etree, HelperTestCase, BytesIO, _bytes try: from Queue im...
stress.py
#!/usr/bin/python3 """ A web stressor to test your infrastructure """ from multiprocessing import Process import requests # send a request def send_request(url): while True: requests.get(url) if __name__ == "__main__": conn_pool = [] url = input("what url do you want to send to: ") for i ...
application.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import codecs import collections import errno import numbers from optparse import OptionParser import os import platform import re import select import shlex import signal import sys import threading import time if platform.system() == 'Wi...
gui.py
#!/usr/bin/python2 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'camara_ui.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets import sys import cv2 import numpy as np import threading im...
stage_manager.py
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
sclass.py
from abc import ABCMeta, abstractmethod from zlib import decompress from collections import namedtuple from biliLive.http_api import Link from threading import Thread, Lock import biliLive.bilibiliApi as bapi import requests import sys import os import time import websocket import json import struct HeaderTuple = name...
tc_test.py
#!/usr/bin/env python import sys, random, time, string # overload socket.create_connection import socket real_create_conn = socket.create_connection def set_src_addr(*args): address, timeout = args[0], args[1] source_address = ('1.0.0.1', 0) return real_create_conn(address, timeout, source_address) socket...
Chap10_Example10.31.py
from threading import * class abc: def __init__(self, seat_available): self.seat_available = seat_available self.mylock = Lock() def abc_reserveseat(self, seat_required): self.mylock.acquire(blocking=False) print("Number of seats remaining : ", self.seat_available) if ...
NFCPair1.py
# -- coding: utf-8 -- import threading, time, sys from src.steps.LoginAndLogout import LoginAndLogout from src.steps.AddWirelessUser import AddWirelessUser from src.steps.ChangeWifi import ChangeWifi from src.utils.serport import serport from src.utils.LogUtil import LogUtil from src.utils.LogPath import Path def tr...
profiler_api_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...
PID_reader.py
import time import threading from random import seed from random import random from IPython.display import display import math class PID_Tester: def __init__(self, ui=False, smell_engine=False, PID_MODE=False, cont_read_conc=False,sampling_rate=50): self.ui = ui self.smell_engine = ...
test_functional.py
# Copyright (c) 2014 Mirantis Inc. # 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 require...
_threading_local.py
"""Thread-local objects (Note that this module provides a Python version of thread threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the local class from threading.) Thread-local objects support the management of thread-local dat...
main.py
import telebot import os import re import threading import feedparser import sqlite3 import time from config import TOKEN, super_users from make_db import tablesName bot = telebot.TeleBot(TOKEN) bot_id = bot.get_me().id bot_username = '@'+bot.get_me().username url = "https://aosus.org/latest.rss" sleep = 15 # التحقق...
counter_race.py
import time import random import threading COUNTER = 0 def update(): global COUNTER read_value = COUNTER # reading in the shared resource time.sleep(random.randint(0, 1)) # simulating heavy calculations COUNTER = read_value + 1 if __name__ == '__main__': threads = [threading.Thread(target=u...
linkcheck.py
# -*- coding: utf-8 -*- """ sphinx.builders.linkcheck ~~~~~~~~~~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import socket import threading from os import path from docu...
gui_tools.py
import tkinter as tk import schedule import time import queue import threading from slack_app.slack_message import * class CheckBar(tk.Frame): def __init__(self, options_list, parent=None, side=tk.TOP, anchor=tk.W): tk.Frame.__init__(self, parent) self.vars = list() for opt in options_list...
mnist_lr_grad_avg.py
import argparse import os import sys import torch import torch.distributed as dist import torch.optim as optim from math import ceil from torch.multiprocessing import Process sys.path.append("../") from archived.ec2.trainer import Trainer from archived.ec2 import partition_mnist from archived.pytorch...
__main__.py
"""isort:skip_file""" # first, logging level lower import os os.environ["KCFG_KIVY_LOG_LEVEL"] = os.environ.get("KCFG_KIVY_LOG_LEVEL", "warning") if "KIVY_AUDIO" not in os.environ: os.environ["KIVY_AUDIO"] = "sdl2" # some backends hard crash / this seems to be most stable # next, icon from katrain.core.utils imp...
feature_extraction_node.py
#!/usr/bin/env python3 # Copyright (C) <2020-2021> Intel Corporation # SPDX-License-Identifier: MIT import os import cv2 import numpy as np import time import rospy from sensor_msgs.msg import Image from cv_bridge import CvBridge from image_feature_msgs.msg import ImageFeatures, KeyPoint from std_msgs.msg import Mult...
main.py
# -*- coding: utf-8 -*- import os import time import socket import logging import threading import yaml from scapy.all import * from pathlib import Path from scapy.layers.inet import ICMP from scapy.layers.l2 import * from scapy.layers.inet6 import IP, UDP socket.setdefaulttimeout(20) BUF_SIZE = 10...
droneAPI.py
#!/usr/bin/env python import math import json import Queue import threading FRAME_LOCAL_NED = 1 MAV_CMD_CONDITION_YAW = 115 MAV_CMD_DO_SET_ROI = 201 downloaded = False q = Queue.Queue() def print_json(): while True: msg = q.get() print(json.dumps(msg)) t = threading.Thread(target=print_json,args=())...
main.py
# Standard import hashlib import os import sys import importlib import json import threading import time from urllib import parse import io import zipfile from datetime import datetime # Additional import flask import urllib3 import certifi from google.cloud import firestore from google.cloud import storage as firestor...
__init__.py
import logging import threading import requests import time from .wiegand import Decoder logging.basicConfig(level=logging.DEBUG) class Main: def __init__(self, api_user, api_key): self.cards = {} self.force_sync_now = threading.Event() self.session = requests.Session() self.se...
darknet4.py
#!python3 ''' ############################## ### Receive Video stream ##### ### from Android client ####### ### Use yolo to do detect #### ## (return a message to the mobile device) ## ############################## ''' from ctypes import * import math import random import os import socket import time import cv2 impor...
Geiger_Counter.py
""" Contador Geiger-Müller Luis Eduardo Sánchez González Facultad de Ciencias Físico Matemáticas Física Computacional sáb 01 may 2021 10:12:14 CDT Repositorio: https://github.com/Luis2501/Fisica-Computacional-1 """ import numpy as np from time import sleep from random import random from tkinter import * import th...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
util.py
import math import cv2 import tensorflow as tf import os import sys ''' output states: 0: has rewards? 1: stopped? 2: num steps 3: ''' STATE_REWARD_DIM = 0 STATE_STOPPED_DIM = 1 STATE_STEP_DIM = 2 STATE_DROPOUT_BEGIN = 3 def get_expert_file_path(expert): expert_path = 'data/artists/fk_%s/' % expert ...
stage_visualizer.py
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make flash" (Ctrl-T Ctrl-F) # - Run "make app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is detected, gdb is automa...
btmaketorrentgui.py
#!/usr/bin/env python # Written by Bram Cohen # modified for multitracker by John Hoffman # see LICENSE.txt for license information import sys import os import threading from BitTornado.BT1.makemetafile import make_meta_file, completedir from BitTornado.Info import MetaInfo try: from wxPython import wx except: ...
test_caching.py
# Copyright 2016 Quora, 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...
lutron-poly.py
#!/usr/bin/env python3 """ LiFX NodeServer for UDI Polyglot v2 by Einstein.42 (James Milne) milne.james@gmail.com """ import polyinterface import time import sys from copy import deepcopy import json import pylutron from threading import Thread from pathlib import Path import math LOGGER = polyinterface.LOGGER with...
rebalance.py
#!/usr/bin/env python3 from pyln.client import Plugin, Millisatoshi, RpcError from threading import Thread, Lock from datetime import timedelta import time import uuid plugin = Plugin() plugin.rebalance_stop = False def setup_routing_fees(plugin, route, msatoshi): delay = plugin.cltv_final for r in reversed(...
SimpleKeyGen.py
import rstr import re import PySimpleGUI as sg from threading import Thread def pattern_gen(pattern): spl_characters = re.compile(r'[@_!#$%^&*()<>?/\|}{~:]') if spl_characters.search(pattern) is not None: r = rstr.xeger(pattern.replace("X", "[A-Z]").replace("x", "[a-z]").replace("D", "\d")) r ...
hello.py
#!/usr/bin/python3 import time, uuid import threading import traceback import sys import os import socket import collections import dbus.service from dbus.mainloop.glib import DBusGMainLoop from gi.repository import GObject scriptDir = os.path.dirname(os.path.realpath(__file__)) sys.path.append( scriptDir + "/common"...
test_movebcolz.py
import logging import os import numpy as np import pandas as pd import pytest import redis import shutil import socket import threading import time from bquery import ctable from time import sleep from uuid import uuid4 import bqueryd TEST_REDIS = 'redis://redis:6379/0' @pytest.fixture def redis_server(): """ ...
clines.py
import pathlib import os import threading from lib.progressbar import progressbar import colorama import time import sys total_amount_of_lines = 0 total_amount_of_nonempty_lines = 0 def summary_and_quit(): print(f"\n\n Summary: {total_amount_of_lines} line(s)\n {total_amount_of_nonempty_...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading from electrum.bitcoin import TYPE_ADDRESS from electrum.storage import WalletStorage from electrum.wallet import Wallet from electrum.paymentrequest import InvoiceStore from electrum.util import pro...
odps_io.py
# Copyright 2020 The ElasticDL Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
coroutine_threadsafe.py
import asyncio import time import logging from threading import Thread from nats.aio.client import Client as NATS from nats.aio.errors import ErrConnectionClosed, ErrTimeout class Component: component = None def __init__(self): self.nc = NATS() self.loop = asyncio.new_event_loop() if n...
start.py
#!/usr/bin/env python3 from concurrent.futures import ThreadPoolExecutor, as_completed from contextlib import suppress from itertools import cycle from json import load from logging import basicConfig, getLogger, shutdown from math import log2, trunc from multiprocessing import RawValue from os import urandom as randb...
client.py
# Copyright (c) 2012-2014 Roger Light <roger@atchoo.org> # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # and Eclipse Distribution License v1.0 which accompany this distribution. # # The Eclipse Public License is available at ...
tools.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals, print_function """ This file contains utilities to generate test repositories. """ import datetime import io import os import threading import time import six im...
install.py
# Date: 01/09/2019 # Author: Mohamed # Description: Install file from time import sleep from queue import Queue from os.path import exists from subprocess import Popen from threading import Thread, RLock class Install: def __init__(self, path_to_req): self.lock = RLock() self.is...
test_process_3.py
########################################################################## # Testing of python process ########################################################################## import logging from multiprocessing import Queue, Process, Event, Lock # Loop until stop def loop(queue, stop, lock, logger): """ run the...
utils.py
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2014 Sean Vig # Copyright (c) 2014-2015 Tycho Andersen # # 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 Soft...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 def incrementingFunction(): glob...
datasets.py
# Dataset utils and dataloaders import glob import logging 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 import torch.nn.functional ...
test_sys.py
import unittest, test.support from test.support.script_helper import assert_python_ok, assert_python_failure import sys, io, os import struct import subprocess import textwrap import warnings import operator import codecs import gc import sysconfig import locale # count the number of test runs, used to create unique #...
load.py
""" This is the "load and transform" part of our ELT. There are three options for accomplishing this: (1) a "load" command will start building the data warehouse from scratch, usually, after backing up. (2) an "upgrade" command will try to load new data and changed relations (without any back up). (3) an "update" com...
base_flasher.py
from .flasher_error import FlasherError import time import flask import requests import tempfile import os import re from threading import Thread class BaseFlasher: def __init__(self, settings, printer, plugin, plugin_manager, identifier, logger): self._settings = settings self._printer = printer self._plugin...
stockwatcher.py
#!/usr/bin/python # -*- coding: utf-8 -*- ######################################################################## # Name: # stockwatcher.py # Description: # GUI tools, display stocks in a floating windows. # Author: # wesley wu # Python: # 3.5+ # Version: # 1.0 ############################################...
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 ...
process.py
import os import json import logging import subprocess import time from multiprocessing import Process, Queue logger = logging.getLogger(__name__) class Loader: def __init__(self): self._files = [] self._classes = {} self._modules = [] def get_modules(self): return self._modu...
ModelSEEDCOBRAServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
loggly_handler.py
from __future__ import absolute_import import atexit import json import os import threading from functools import partial import sys import requests from restapi_logging_handler.restapi_logging_handler import ( RestApiHandler, serialize, ) def setInterval(interval): def decorator(function): def...
server_tests.py
#!/usr/bin/python2.7 # Copyright 2012 Google 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 ...
_channel_close_test.py
# Copyright 2018 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
camera.py
import cv2 import atexit import traitlets import threading import numpy as np class GStreamerCamera(traitlets.HasTraits): value = traitlets.Any() width = traitlets.Integer(default_value=320) height = traitlets.Integer(default_value=180) running = traitlets.Bool(default_value=False) src = traitlets...
test_distributed_sampling.py
import dgl import unittest import os from dgl.data import CitationGraphDataset from dgl.distributed import sample_neighbors from dgl.distributed import partition_graph, load_partition, load_partition_book import sys import multiprocessing as mp import numpy as np import backend as F import time from utils import get_lo...
utils.py
""" Helpful functions that don't belong in a more specific submodule. """ import importlib import logging import os import pkgutil import signal import uuid from contextlib import contextmanager from inspect import isclass, isfunction from multiprocessing import Process from ophyd.signal import EpicsSignalBase logger...
test_threadworker.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted._threads._threadworker}. """ import gc import weakref from twisted.trial.unittest import SynchronousTestCase from threading import ThreadError, local from .. import ThreadWorker, LockWorker, AlreadyQuit class FakeQueu...
tester.py
#!/usr/bin/python3 # Copyright 2018-2019 Leland Lucius # # 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...
cli.py
import ast import inspect import os import platform import re import sys import traceback from functools import update_wrapper from operator import attrgetter from threading import Lock from threading import Thread import click from werkzeug.utils import import_string from .globals import current_app from .helpers im...
gcsio.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
optimization.py
import hashlib import json import six from copy import copy, deepcopy from datetime import datetime from itertools import product from logging import getLogger from threading import Thread, Event from time import time from typing import List, Set, Union, Any, Sequence, Optional, Mapping, Callable from .job import Clea...
metricscollection.py
#!/opt/local/bin/python3 version = 'v2019-12-20' ######################################################################################### # # # ...
start_threads.py
import threading import time def do_it() -> None: time.sleep(0.0000001) print("did it") thread1 = threading.Thread(target=do_it) print("getting ready to call start") thread1.start() print("some thread independent operation") thread1.join() print("done")
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import json import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from tools.general import xyxy2xywh, xywh2xy...
__init__.py
# # Unit tests for processing package # import unittest import threading import Queue import time import sys import os import signal import array import copy import socket import random import logging import ctypes import processing.dummy import processing.connection import processing.managers im...
openNeuroService.py
""" A command-line service to be run where the where OpenNeuro data is downloaded and cached. This service instantiates a BidsInterface object for serving the data back to the client running in the cloud. It connects to the remote projectServer. Once a connection is established it waits for requets and invokes the Bids...
bot.py
import os,sys,logging,time,json,datetime,random,numpy from trader import Trader from marketanalyzer import Analyzer from botdata import BotDataProvider from tcpsock import TcpSock from bittrex import Bittrex from scraper import Scraper from tradewallet import TradeWallet from mongowrapper import MongoWrapper from threa...
putobject.py
# Copyright 2013-2014 Eucalyptus Systems, Inc. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of source code must retain the above copyright notice, # this list of conditions ...
ble_logger_SensorMedal2_udp_tx.py
#!/usr/bin/env python3 # coding: utf-8 ################################################################################ # BLE Logger for Rohm SensorMedal-EVK-002 [UDPデータ送信機能付き] # Raspberry Piを使って、センサメダルのセンサ情報を表示します。 # # Copyright (c) 2019 Wataru KUNINO ####################...
test_channel.py
from __future__ import absolute_import import unittest import base64 import json import threading import time from mock import call, patch, MagicMock from dxlstreamingclient.channel import \ (ConsumerError, Channel, ChannelAuth, _PRODUCE_CONTENT_TYPE) from dxlstreamingclient.error import TemporaryError def create...
runmultiagent.py
# ------------------------------------------------------------------------------------------------ # Copyright (c) 2018 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 ...
bm_deltablue.py
""" deltablue.py ============ Ported for the PyPy project. Contributed by Daniel Lindsley This implementation of the DeltaBlue benchmark was directly ported from the `V8's source code`_, which was in turn derived from the Smalltalk implementation by John Maloney and Mario Wolczko. The original Javascript implementati...
test_views.py
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import time from threading import Thread from django import forms from django.core.urlresolvers import reverse from django.http import HttpRequest, QueryDict from django.test import TestCase, override_settings from d...
unit_tests.py
import sys, unittest sys.path.insert(0,'../..') sys.path.insert(1,'..') from legacy_test.setup import DefaultSetupMixin, ParseYAMLSetupMixin, PostgresSetupMixin from legacy_test.models import ExemplaryModel, CustomersModel, OrdersModel, ArticlesModel from sqlalchemy_acl import ACL from sqlalchemy import func from ran...
cis_scraper.py
from lxml import etree as ET from urllib.request import urlopen from time import sleep import re import csv from threading import Thread # ---------------------- Fields -------------------------------------- fields = ["year", "term", "college", "subject", "subject_name", ...
agent.py
#!/usr/bin/env python import threading import time import random import sock import sp_exceptions import handler from world_model import WorldModel class Agent: def __init__(self): # whether we're connected to a server yet or not self.__connected = False # set all variables and important...
demo_threading_queue.py
from queue import Queue from random import randint from threading import Thread from time import sleep ''' Python 3.X threading 与 Queue 结合演示 Demo 经典的并发生产消费者模型 ''' class TestQueue(object): def __init__(self): self.queue = Queue(2) def writer(self): print('Producter start write to queue.') ...
PyV8.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, re import logging import collections is_py3k = sys.version_info[0] > 2 if is_py3k: import _thread as thread from io import StringIO str = str raw_input = input else: import _thread try: from io import Str...
api.py
from datetime import datetime, timedelta, timezone import logging.config import multiprocessing from flask import Flask, jsonify, request from globus_action_provider_tools.authentication import TokenChecker from globus_action_provider_tools.validation import ( request_validator, response_validator ) from isoda...
signal_trace_test.py
#!/usr/bin/env vpython3 # Copyright 2017 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import logging import os import signal import subprocess import sys import unittest import six THIS_DIR = os.path.dirnam...