source
stringlengths
3
86
python
stringlengths
75
1.04M
run_multi_agent.py
import os from argparse import ArgumentParser from multiprocessing import Process, active_children from time import sleep from common import parse_clients_args from missions.multi_agent import MultiAgent def agent_factory(name, role, clients, agent_type, steps, mission, mode): from missions.multi_agent import Mu...
spotifyAccount.py
import platform import random import string import threading import request import time from os import system if platform.system() == "Linux": title = "Linux" elif platform.system() == "Windows": title = "Windows" else: title = "Mac OsX" def setRandomName(size = 10, chars = string.ascii_letters + string.d...
keep_alive.py
from flask import Flask, render_template from threading import Thread app = Flask('') @app.route('/') def home(): return "Online!" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
upgrade_gsi.py
import copy import logging from datetime import datetime from threading import Thread from .base_gsi import BaseSecondaryIndexingTests from couchbase_helper.query_definitions import QueryDefinition from membase.helper.bucket_helper import BucketOperationHelper from newupgradebasetest import NewUpgradeBaseTest from rem...
co2meter.py
""" Class for reading data from CO2 monitor. (c) Vladimir Filimonov, 2016-2018 E-mail: vladimir.a.filimonov@gmail.com """ try: import hid except AttributeError as e: if 'windll' in e.message: raise ImportError(('Import failed with an error "AttributeError: %s". ' 'Pos...
queries.py
import threading from typing import Any import pandas as pd from io import BytesIO from asyncio import sleep from datetime import timedelta from aiohttp import ClientSession from datetime import datetime as dt from qiwipyapi import Wallet from aiogram.dispatcher.storage import FSMContext from aiogram.types import (Cal...
mdtest.py
# encoding: UTF-8 import sys,os from time import sleep #from qtpy import QtGui vnpy_root = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','..','..','..','..')) if vnpy_root not in sys.path: print(u'append {}'.format(vnpy_root)) sys.path.append(vnpy_root) from vnpy.api.ctp_se.vnctpmd import MdAp...
CMSCrawler.py
from multiprocessing import Process,Queue import requests import urllib3 from random import choice import string import shutil import os import sys urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) ############################# ########## Const ############ ############################# config_path...
driver.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 Univer...
serial_test.py
# # DAPLink Interface Firmware # Copyright (c) 2009-2016, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
test_basic_workflows_3.py
import pytest from filelock import FileLock from pathlib import Path import ray from ray import workflow from ray.tests.conftest import * # noqa def test_wf_run(workflow_start_regular, tmp_path): counter = tmp_path / "counter" counter.write_text("0") @ray.remote def f(): v = int(counter.rea...
train_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Trains and tests a DenseNet on CIFAR-10. For usage information, call with --help. Author: Jan Schlüter """ import os from argparse import ArgumentParser from functions_0 import * def opts_parser(): usage = "Trains and tests a DenseNet on CIFAR-10." parser ...
test.py
#!/usr/bin/env python3 import json import os import requests import tempfile import time import threading import queue import unittest from multiprocessing import Process from pathlib import Path from unittest import mock from websocket import ABNF from websocket._exceptions import WebSocketConnectionClosedException ...
clientside.py
#!/usr/bin/env python3 import socket import sqlite3 import threading import time import traceback from datetime import datetime from constants import * lock = threading.Lock() min_noninserted_conn_id = SEQ_MIN_VALUE next_conn_id = SEQ_MIN_VALUE data_from_db = {} # : dict[int, tuple[bool, bytes]] data_to_db = {} # ...
process.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apkleaks.py
#!/usr/bin/env python3 from apkleaks.colors import clr from contextlib import closing from distutils.spawn import find_executable from pyaxmlparser import APK from urllib.request import urlopen from zipfile import ZipFile import io import json import logging.config import mimetypes import numpy import os import re impo...
Server.py
import numpy as np import errno from threading import Thread, Lock import time from contextlib import contextmanager import os import json from utils_ import * import socket def server(data_dict, ADDR): """ Listen and connect with clients. :param data_dict: store data and exit flag :par...
app.py
""" A REST API for Salt =================== .. py:currentmodule:: salt.netapi.rest_cherrypy.app .. note:: This module is Experimental on Windows platforms and supports limited configurations: - doesn't support PAM authentication (i.e. external_auth: auto) - doesn't support SSL (i.e. disable_ssl: Tru...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import deserialize_xpub from electrum import constants from electrum.i18n import _ from electrum.transac...
__init__.py
# -*- coding: UTF-8 -*- #virtualBuffers/__init__.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2007-2017 NV Access Limited, Peter Vágner import time import threading import ctypes import collection...
CvContext.py
#!/usr/bin/env python # # Copyright (c) Commvault Systems (2016). All Rights Reserved. # ''' Commvault integration with Greenplum data protection This Module contains some helper functions for storing information needed to run Greenplum backup and restore using Commvault Typical usage: from gppylib import CvContex...
app.py
from os import replace from numpy.core.fromnumeric import size import pandas as pd import numpy as np import schedule from config import create_api import tweepy import time import random import threading ht1 = [ '#books', '#bookstagram', '#book', '#booklover', '#reading', '#bookworm', '#bookstagrammer', '#bookis...
client.py
import time import threading import socket import zlib import sys import serpent from Pyro5.api import Proxy, current_context def regular_pyro(uri): blobsize = 10*1024*1024 num_blobs = 10 total_size = 0 start = time.time() name = threading.currentThread().name with Proxy(uri) as p: for...
watch.py
import logging import threading import grpc import six from six.moves import queue import etcd3.etcdrpc as etcdrpc import etcd3.events as events import etcd3.exceptions as exceptions import etcd3.utils as utils _log = logging.getLogger(__name__) class Watch(object): def __init__(self, watch_id, iterator=Non...
sms.py
from os.path import abspath as abspath from os.path import dirname as dirname from os.path import join as join import sys, json import logging import nexmo # SMS Provider from subprocess import call # to execute a shell command from threading import Thread # to launch an async thre...
copyutil.py
# cython: profile=True # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
image_utils.py
import io import requests from PIL import Image from utils_all.utils_all import * import threading thread_pools=[] from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True # important to avoid def download_images(img_urls,save_files,size=(512,512), no_threads=6): for i in range(len(img_urls)): wh...
ROSBagAPIThreadRecorder.tpl.py
{% block meta %} name: ROSBagAPIThreadRecorder description: > SMACH template that provides a ROSBagAPIThreadRecorder helper class for RecordROSBagState. It uses the rosbag API (application programming interface) as well as the threading library in order to manage multiple recording threads. NOTE: this means tha...
ben_test.py
import os from ont_fast5_api.fast5_interface import get_fast5_file from ont_fast5_api.analysis_tools.basecall_1d import Basecall1DTools import time from multiprocessing import Pool, Process from joblib import Parallel, delayed def fast5s_to_fastq(dir_): print(dir_) start = time.time() plus = '+' fastq...
Server.py
''' author: ywxk target: realize the features of chat 2017.11.14 ''' import sys import time import socket import pymysql import threading from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * addr = ("127.0.0.1", 3300) class Link: # 初始化TCP onlines = 0 user...
resource_monitor.py
# Copyright (c) Peng Cheng Laboratory # All rights reserved. # # MIT License # # 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 ...
lab11_e.py
from asyncio.windows_events import NULL from sys import setrecursionlimit import threading setrecursionlimit(10 ** 9) threading.stack_size(3 * 67108864) def main(): inf = 10 ** 9 #Ford-Bellman algo https://e-maxx.ru/algo/negative_cycle file_input, file_output = open('negcycle.in', 'r'), open('negcycle.out'...
__init__.py
from __future__ import unicode_literals import threading import logging from functools import wraps from tests import TestCase as BaseTestCase from werkzeug.serving import make_server from flask import g, session, redirect from catsnap.web import app from nose.tools import nottest from splinter import Browser from spl...
test_capture_http_proxy.py
from warcio.capture_http import capture_http import threading from wsgiref.simple_server import make_server, WSGIServer import time import requests from warcio.archiveiterator import ArchiveIterator from pytest import raises # ================================================================== class TestCaptureHttp...
test_cmd2.py
# coding=utf-8 # flake8: noqa E302 """ Cmd2 unit/functional testing """ import argparse import builtins import io import os import sys import tempfile from code import InteractiveConsole import pytest # Python 3.5 had some regressions in the unitest.mock module, so use 3rd party mock if available try: import mock...
paac.py
import time, logging, zmq, re from flask import Flask, request from multiprocessing.sharedctypes import RawArray from ctypes import c_uint, c_float from actor_learner import * from emulator_runner import EmulatorRunner from runners import Runners from zmq_serialize import SerializingContext from multiprocessing import ...
tcp_client.py
#!/usr/bin/env python from threading import Event, Thread from util import * import sys import logging import socket import struct logger = logging.getLogger('client') logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s') class TcpClient: def __init__(self, stun_host, stun_port): s...
hdfs_utils.py
# Copyright (c) 2018 PaddlePaddle 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 app...
mp_spotfinder_server_read_file.py
from __future__ import absolute_import, division, print_function from BaseHTTPServer import HTTPServer import cgi, sys from multiprocessing import Process, current_process from urlparse import urlparse from six.moves import range #backward compatibility with Python 2.5 try: from urlparse import parse_qs except Excepti...
web_server.py
# Sincroniza Web App - Por João Lucas | Desenvolvido como requisito para a Mostra Cientifica import socket import threading from utils import * from urllib.parse import unquote from python_parser import pythonfier content_dir = "web/" class WebServer(object): def __init__(self, port): self.port = port ...
java_gateway.py
# -*- coding: UTF-8 -*- """Module to interact with objects in a Java Virtual Machine from a Python Virtual Machine. Variables that might clash with the JVM start with an underscore (Java Naming Convention do not recommend to start with an underscore so clashes become unlikely). Created on Dec 3, 2009 :author: Barthe...
test_queue.py
import queue import time import unittest from test import support threading = support.import_module('threading') QUEUE_SIZE = 5 def qfull(q): return q.maxsize > 0 and q.qsize() == q.maxsize class _TriggerThread(threading.Thread): def __init__(self, fn, args): self.fn = fn self.args = args ...
run.py
import logging, json from socket import timeout from bottle import route, response, request, run from mh_device import MagicHomeDevice from workers import StoppableThread, sync_screen sync_worker = StoppableThread(target=sync_screen, args=("light", 1)) @route('/api/state', method='GET') def get_state(): status ...
barcode_reader.py
import sys import os import json import re import threading import lzstring #import requests import serial from enum import Enum from time import sleep from datetime import datetime from scripts.helpers import get_args, get_ports from scripts.ymq import YPubNode import base64 class Person: def __init__(self, iden...
analyzeAll_customDir.py
import cPickle import sys import numpy import glob import gzip import copy import sys import threading import Queue import time ligands = [] allScoreList = [] allScoreListDict = {} #scoreDict = {} #resultsDir = '../dockingResults/' #resultsDir = '../dockingResults_20140816shapes_peelDock_fullRadius_normed/' resultsDi...
client.py
import threading from datetime import datetime from functools import lru_cache from typing import Any import zmq from zmq.backend.cython.constants import NOBLOCK from .common import HEARTBEAT_TOPIC, HEARTBEAT_TOLERANCE class RemoteException(Exception): """ RPC remote exception """ def __init__(self...
core.py
import marshal import os.path import sys import threading import time import traceback import pyttsx import re import random # Howie-specific import aiml import configFile import frontends from frontends import * #import speech_recognition as sr speech_engine = pyttsx.init('sapi5') # see http://pyttsx.readthedocs.org...
youtube-dl-server.py
from __future__ import unicode_literals import json import os import subprocess from queue import Queue from bottle import route, run, Bottle, request, static_file from threading import Thread import youtube_dl from pathlib import Path from collections import ChainMap app = Bottle() app_defaults = { 'YDL_FORMAT'...
test_client.py
# test_client.py -- Compatibilty tests for git client. # Copyright (C) 2010 Google, Inc. # # Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU # General Public License as public by the Free Software Foundation; version 2.0 # or (at your option) any later version. You can redistribute it and/or ...
testing.py
from __future__ import division # pylint: disable-msg=W0402 import random import re import string import sys import tempfile import warnings import inspect import os import subprocess import locale import unittest import traceback from datetime import datetime from functools import wraps, partial from contextlib impo...
main.py
import multiprocessing import os import pickle import sys import win32api storefile = '.\\store.bin' class junction: def __init__(self): self.src = "" self.links = [] self.link = [] self.dict = {} self.key = self.src self.val = self.links self.prtline = "" self.tabs = 20 sp1 = '\t' * (tabs - get_...
mlemultiprocessing.py
''' MAGeCK MLE multiprocessing ''' import re import sys import logging import multiprocessing import copy import numpy as np import signal from mageck.mleem import iteratenbem # debug try: from IPython.core.debugger import Tracer except: pass def thread_p_func(dinst,args,iteratenbemargs,returndict): ''' fu...
run_with_env.py
import pathlib from typing import Dict, List, Optional, Tuple import sys import os import itertools from functools import partial import threading import time from robocorp_ls_core.robotframework_log import get_logger log = get_logger(__name__) def create_run_with_env_code( robo_env: Dict[str, str], base_executa...
test_data.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.data""" import glob import os import os.path import re import sqlite3 import threading import mock from coverage.data import CoverageData, ...
cloud_verifier_tornado.py
#!/usr/bin/python3 """ SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. """ import asyncio import functools import os import signal import sys import traceback from multiprocessing import Process import tornado.ioloop import tornado.web from sqlalchemy.exc import SQLAlchemyErro...
job.py
import logging import traceback from queue import Queue from threading import Thread class RetryException(Exception): retry_count = 1 pass class ItemWrapper(): def __init__(self, item): self.item = item class Job: def __init__(self, numThreads, iterable=[], func=None, raiseException=False...
_profiling.py
import json import os import threading import tensorflow as tf from tensorflow.python.client import timeline class Timeliner: # _timeline_dict = None # options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) # run_metadata = tf.RunMetadata() def update_timeline(self, chrome_trace): # ...
signal.py
from threading import Thread from multi_tenant.tenant.models import Tenant, GlobalUser from django.db.models.signals import post_save # 另外一个内置的常用信号 import logging from django.dispatch import receiver from multi_tenant.tenant import get_tenant_model, get_tenant_user_model Tenant = get_tenant_model() logger = logging...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import tempfile import threading import time import unittest import warnings from unittest import mock from django.conf import settings from django.core...
box_backup.py
#!/usr/bin/python3 # The MIT License (MIT) # # Copyright (c) 2017 Kyle Barlow # # 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 #...
darknet1.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...
run.py
import logging import os import signal import threading import sys import time from queue import Queue from src.GUI.gui import MainWindow from src.bluetooth_node.blue_node import BlueNode from src.handler.handler import Handler from src.monitor.monitor import Monitor from options import Args def read_key_val_file(na...
pool.py
# -*- coding: utf-8 -*- # # Module providing the `Pool` class for managing a process pool # # multiprocessing/pool.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import # # Imports # import copy import errno import itertools import os import...
2_gather_256vox_16_32_64.py
import numpy as np import cv2 import os import h5py from scipy.io import loadmat import random import json from multiprocessing import Process, Queue import queue import time #import mcubes class_name_list_all = [ "02691156_airplane", "02828884_bench", "02933112_cabinet", "02958343_car", "03001627_chair", "03211117_di...
workerResultLog.py
# -*- coding: utf-8 -*- from polylogyx.application import create_app from polylogyx.settings import CurrentConfig from polylogyx.tasks import analyse_result_log_data_with_rule_ioc_intel import threading app = create_app(config=CurrentConfig) def match_with_rules(): while True: print('executing a...
old_email.py
from flask_mail import Message from app import app, mail from threading import Thread from flask import render_template from flask_babel import _ def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=...
try_proxies.py
"""爬代理""" import os import sys sys.path.append(os.pardir) import threading from math import ceil from lazy_spider.utils import get_sqlite_db from lazy_spider.generic.proxy import * def clear_proxies(checker: GenericProxyChecker, pool: SqliteProxyPool, proxies): for proxy in proxies: try: r...
offlinescreen.py
from kivy.uix.screenmanager import Screen from ui.modals import GameModal import threading class OfflineScreen(Screen): active_pop = None #active popup on the screen def __init__(self,CApp,**kwargs): super(OfflineScreen, self).__init__(**kwargs) self.app = CApp def training(self, *args): ...
spoof.py
from selenium import webdriver from os import system from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options import json, os, zipfile, threading, time def threaded_spoof_not_auth(website,PROXY,path): options = webdriver.ChromeOptions()...
test_main.py
import asyncio import threading import time import pytest import requests from uvicorn.config import Config from uvicorn.main import Server async def app(scope, receive, send): assert scope["type"] == "http" await send({"type": "http.response.start", "status": 204, "headers": []}) await send({"type": "h...
miniterm.py
#!/home/pi/Adafruit_CircuitPython_ServoKit/envSERVOKIT/bin/python3 # # 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 threading im...
test_windows_events.py
import os import signal import socket import sys import time import threading import unittest from unittest import mock if sys.platform != 'win32': raise unittest.SkipTest('Windows only') import _overlapped import _winapi import asyncio from asyncio import windows_events from test.test_asyncio import utils as te...
bench_db_client.py
import argparse import logging import multiprocessing import os import pathlib import random import signal import sys import tempfile import time from eth.db.backends.level import LevelDB from trinity.db.manager import ( DBManager, DBClient, ) logger = logging.getLogger('trinity.scripts.benchmark') logger.se...
test_deleter.py
import os import time import threading import unittest from collections import namedtuple import selfdrive.loggerd.deleter as deleter from common.timeout import Timeout, TimeoutException from selfdrive.loggerd.tests.loggerd_tests_common import UploaderTestCase Stats = namedtuple("Stats", ['f_bavail', 'f_blocks', 'f_...
TFCluster.py
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """ This module provides a high-level API to manage the TensorFlowOnSpark cluster. There are three main phases of operation: 1. **Reservation/Startup** - reserves a port for the T...
connection.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...
pubsub.py
import time import threading from space_api import API api = API('books-app', 'localhost:4124') pubsub = api.pubsub() def on_receive(subject, msg): print("received", subject, msg) subscription = pubsub.subscribe("/subject/", on_receive) print(subscription) def publish(): for i in range(30): msg =...
zmq_example.py
#!/usr/bin/env python3 # A simple "chat" program to demonstrate the use of ZeroMQ interface # with the modem application. # Since the modem currently supports only fixed-length frames, # they are padded with spaces and stripped after receiving. FRAME_LENGTH = 100 import zmq, threading, struct ctx = zmq.Context() rx ...
settings_20210906114611.py
""" Django settings for First_Wish project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathli...
__init__.py
# -*- coding: utf-8 -*- # Author: Florian Mayer <florian.mayer@bitsrc.org> # # This module was developed with funding provided by # the ESA Summer of Code (2011). # #pylint: disable=W0401,C0103,R0904,W0141 from __future__ import absolute_import """ This module provides a wrapper around the VSO API. """ import re imp...
app.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import tricks import rig import time from multiprocessing import Process, Manager from pyglet.gl import * from pyglet.window import key from pyglet import clock from tricks import * from os.path import sep from math import sqrt from copy import deepcopy ...
tpls_server.py
# server.py import logging logging.basicConfig(level=logging.DEBUG, format='%(message)s', ) import datetime as dt import logging import sys import socketserver logging.basicConfig(level=logging.DEBUG, format='%(name)s: %(message)s', ) local_ip = "192.168.1.5" n_port = 1234 tw ...
performance_monitor.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: leeyoshinari import os import re import time import json import queue import traceback import threading from concurrent.futures import ThreadPoolExecutor import requests import influxdb from logger import logger, cfg, handle_exception class PerM...
widget.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) The widget is called from web2py ---------------------------------- """ import datetime import sys i...
project_summary_upload_LIMS.py
#!/usr/bin/env python """Script to load project info from Lims into the project database in statusdb. Maya Brandi, Science for Life Laboratory, Stockholm, Sweden. """ from __future__ import print_function from genologics.config import BASEURI, USERNAME, PASSWORD from genologics.lims import * from LIMS2DB.objectsDB.fun...
generic_its.py
#!/usr/bin/env python from __future__ import division import subprocess import os import logging import sys import tempfile import math import random import time import numpy as np import json import warnings import multiprocessing as mp from k_shortest_paths import k_shortest_paths from optparse import OptionParser...
test_change_stream.py
# Copyright 2017 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
rocket.py
# -*- coding: utf-8 -*- # This file is part of the Rocket Web Server # Copyright (c) 2011 Timothy Farrell # Import System Modules import sys import errno import socket import logging import platform import traceback # Define Constants VERSION = '1.2.4' SERVER_NAME = socket.gethostname() SERVER_SOFTWARE = 'Rocket %s'...
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...
test_radius.py
# RADIUS tests # Copyright (c) 2013-2016, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. from remotehost import remote_compatible import binascii import hashlib import hmac import logging logger = logging.getLogger() import os import sele...
multiprocess_main.py
# -*- encoding: utf-8 -*- import multiprocessing as mp import time from pudb.remote import set_trace def worker(worker_id): """ Simple worker process""" i = 0 while i < 10: if worker_id == 1: # debug process with id 1 set_trace(term_size=(80, 24)) time.sleep(1) # represents ...
graph_maker.py
# * MakeGraphUsingTinyEKFDLL # * # * Copyright (C) 2022 DukiChoi # * # * MIT License # -*- coding: utf-8 -*- from calendar import c from inspect import _void import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.animation as animation from mpl_toolkits.mplot3d imp...
socket_sender.py
import os import json import logging import datetime from threading import Thread logger = logging.getLogger(__name__) # The SocketSender runs a thread that sends messages (temporarily stored in DB) out to websockets. class SocketSender(Thread): def __init__(self): logger.info('init socket sender') ...
server.py
# Much of this code follows verbatim after David Beazley's excellent "Concurrency from the Ground Up" # https://www.youtube.com/watch?v=MCs5OvhV9S4 # Please refer to David's terms of license; the MIT license might not apply to this code # server.py # Fib microservice from socket import * from fib import fib from thre...
test_subprocess.py
import unittest from test import test_support import subprocess import sys import platform import signal import os import errno import tempfile import time import re import sysconfig try: import ctypes except ImportError: ctypes = None try: import resource except ImportError: resource = None try: ...
server.py
import math import os import queue import sys import threading import time import uuid from collections import namedtuple from concurrent.futures import ThreadPoolExecutor from threading import Event as ThreadingEventType from time import sleep import grpc from dagster import check, seven from dagster.core.code_pointe...
local_agent.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Email: chenwx716@139.com # DateTime: 2018-11-22 16:24:44 __author__ = "chenwx" import random import time import socket import base64 import requests import json import hashlib import threading import os import logging import yaml from pathlib import Path streams = [None, N...
eventEngine.py
# encoding: UTF-8 # 系统模块 from __future__ import print_function from queue import Queue, Empty from threading import Thread from time import sleep from collections import defaultdict # 第三方模块 from qtpy.QtCore import QTimer # 自己开发的模块 from myquant.event.eventType import * ##############################################...
recipe-577350.py
import threading class WorkersLounge(object): def __init__(self, total_workers_number): """ @param total_workers_number: the maximum number of worker threads """ self.total_workers_number = total_workers_number self.waiting_place = threading.Condition() self.work_done_event = threading.Event() def r...
main.py
#!/usr/bin/env python ############################################################################### # bitcoind-ncurses by Amphibian # thanks to jgarzik for bitcoinrpc # wumpus and kylemanna for configuration file parsing # all the users for their suggestions and testing # and of course the bitcoin dev team for that ...