source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
celloServer.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... |
Engine.py | # coding: utf-8
# Author: Lyderic LEFEBVRE
# Twitter: @lydericlefebvre
# Mail: lylefebvre.infosec@gmail.com
# LinkedIn: https://www.linkedin.com/in/lydericlefebvre
# Imports
import logging, traceback
from core.User import *
from core.Resources import *
from core.Targets import *
from core.SprayLove import *
from co... |
python_exporter.py | #!/usr/bin/env python
# Copyright (c) 2018-2020 The Mode Group
#
# 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 appl... |
PCpc.py | import os
import wx
from wx import adv
from wx.core import Bitmap, MenuItem
from photoshop import PhotoshopConnection
from PCSocketServer import PCSocketServer
from PCpc_UIClasses import *
class TaskBarIcon(wx.adv.TaskBarIcon):
TRAY_ICON_PSoff = None
TRAY_ICON_PSon = None
def __init__(self):
super(TaskBarIcon, s... |
test_threading.py | """
Tests for the threading module.
"""
import test.support
from test.support import verbose, import_module, cpython_only, unlink
from test.support.script_helper import assert_python_ok, assert_python_failure
import random
import sys
import _thread
import threading
import time
import unittest
import weakref
import os... |
starter_peaks.py | from app.imports import *
from app.watchdogs.custom import CustomFileEventHandler
from app.imports.crysalis.controller import CrysalisController
class Starter:
"""
Handles file tracking for peak hunt files of Crysalis (Rigaku)
"""
WATCHDOG_DELAY = 0.5
DEBUG_MODE = logging.INFO
def __init__(sel... |
echobot.py | # -*- coding: utf-8 -*-
import LineAlpha
from LineAlpha.lib.curve.ttypes import *
from datetime import datetime
# from imgurpython import ImgurClient - Digunain kalo make imgur buat upload image
import time,random,sys,json,codecs,threading,glob,os,subprocess,multiprocessing
#login type bisa, token, qr
#bot.log... |
test_thread_local.py | #! /usr/bin/env python
""" Simple test script for Thread.local
"""
from thread import _local as local
import unittest
from test import test_support
import threading
class ThreadLocalTestCase(unittest.TestCase):
def test_two_locals(self):
'''Ensures that two locals in the same thread have separate dicts.''... |
xxe.py | import socket
import sys
import argparse
import requests
import threading
import time
import hashlib
import os
import sendrequest as req
import utils.logger as logger
import utils.logs as logs
from utils.db import Database_update
dbupdate = Database_update()
# Dummy response
data = b'''\
HTTP/1.1 200 OK\r\n\
Connect... |
datasets.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Dataloaders and dataset utils
"""
import glob
import hashlib
import json
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import Pool, ThreadPool
from pathlib import Path
from threading import Thread
from zipfile im... |
locations2tfrecords.py | #!/usr/bin/env python
import multiprocessing
from subprocess import call
try:
import mapnik2 as mapnik
except:
import mapnik
import sys, os, random as rd
import tensorflow as tf, cv2 , pickle, time
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
def ... |
thread_rlock.py | #导入Thread, RLock类
from threading import Thread, RLock
#初始化全局变量
g_sum = 0
sum = 499995000000
def child_thread(rl):
global g_sum
rl.acquire() #获取可重入锁
rl.acquire() #获取可重入锁
for i in range(100000):
g_sum = g_sum + i
rl.release() #释放可重入锁
rl.release() #释放可重入锁
if __name__ == "__main__":
... |
trading-bot.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... |
nicolive.py | import json
import logging
import re
import threading
import time
from urllib.parse import unquote_plus, urlparse
import websocket
from streamlink.plugin import Plugin, PluginArgument, PluginArguments
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
from streamlink.utils.times impo... |
master_server.py | #!/usr/bin/env python
#
# Copyright 2013 Tanel Alumae
"""
Reads speech data via websocket requests, sends it to Redis, waits for results from Redis and
forwards to client via websocket
"""
import sys
import logging
import json
import codecs
import os.path
import uuid
import time
import threading
import functools
from ... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
Rerequester.py | # Written by Bram Cohen
# modified for multitracker operation by John Hoffman
# see LICENSE.txt for license information
from .. zurllib import urlopen, quote
from urlparse import urlparse, urlunparse
from socket import gethostbyname
from btformats import check_peers
from .. bencode import bdecode
from threading import... |
testSocketRelay.py | from socket import *
import struct
from time import sleep, time
import serial
import subprocess
from threading import Thread
import sys
import os
from deepstream import get
from autonomousCore import *
from leds import writeToBus
global myDriver
global storedPoints
global cmdBuffer
global currentGpsLoc
global ghzConne... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
session.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... |
vis.py | # Copyright (C) 2018 Innoviz Technologies
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD 3-Clause license. See the LICENSE file for details.
import numpy as np
import textwrap
import matplotlib.cm as cm
from multiprocessing import Process, Queue
from queue import ... |
worker.py | from flask import Flask, request
from django.apps import apps
from django.conf import settings
from threading import Thread, Event
import os
from time import sleep
import logging
from datetime import datetime, timedelta
import pytz
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
os.environ['DJANGO_SETTINGS_MODULE']... |
server.py | #!/usr/bin/env python
"""Machine Learning Server."""
# System
import threading
import sys
import os
from datetime import datetime
import logging
# Third Party
import time
from pqueue import Queue
import numpy as np
import schedule
from bottle import run, request, route
from file_manager import FileManager
# First Pa... |
test_flush.py | import time
import pdb
import threading
import logging
from multiprocessing import Pool, Process
import pytest
from utils import *
dim = 128
segment_row_count = 5000
index_file_size = 10
collection_id = "test_flush"
DELETE_TIMEOUT = 60
nprobe = 1
tag = "1970-01-01"
top_k = 1
nb = 6000
tag = "partition_tag"
field_name ... |
test_dota_base_q.py | # -*- coding:utf-8 -*-
# Author: Xue Yang <yangxue-2019-sjtu@sjtu.edu.cn>
#
# License: Apache-2.0 license
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import cv2
import numpy as np
import math
from tqdm import... |
server.py | import socket
import struct
import threading
MCAST_IP = 'localhost'
MCAST_PORT = 5555
RETR_IP = 'localhost'
RETR_PORT = 7777
def create_message_block(msg):
return struct.pack('!H{}s'.format(len(msg)),len(msg),msg)
def pack_messages(session_id,start_seq_num,messages):
msg_blocks = b''.join([ create_message_b... |
monitors_website.py | #!/usr/bin/env python
import asyncio
import json
import threading
import sys
from lib.monitor import Monitor
from lib.stats_writer import StatsWriter
config = json.load(open('config.json'))
def run_monitor():
monitor = Monitor(config)
# asyncio on Windows solution learnt from here: https://github.com/encod... |
test_verified_get_set.py | # Copyright 2021 CodeNotary, 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 required by applicable law or... |
test_c10d_nccl.py | import copy
import math
import os
import random
import signal
import sys
import tempfile
import threading
import time
from contextlib import contextmanager
from datetime import timedelta
from itertools import product
from unittest import mock
import torch
import torch.distributed as c10d
if not c10d.is_available():
... |
shutdown_train_2.py | """Simulate the shutdown sequence on the train pi."""
import socket
import threading
import time
# Phase 2
# listen for shutdown message instead of just the connection
# send sound on/off command to master
# - maybe just an input() to toggle it?
# should master pi have the server socket?
def talk_to_master(startShutd... |
compare_WchainCNOT_qng.py | import qiskit
import numpy as np
import sys
sys.path.insert(1, '../')
import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding
import importlib
import multiprocessing
def run_wchain(num_layers, num_qubits):
thetas = np.ones(num_layers*num_qubits*3)
psi = 2*np.random.rand(2**num_qubits)-1
... |
TrayMsg.py | #coding: utf-8
'''以托盘图标的方式发出右下角的提示信息。'''
# 原来源: http://angeloce.iteye.com/blog/493681
import win32gui
import win32con
import time
import threading
from sine.utils import ReStartableThread
class TrayMsg:
count = 0
lock = threading.Lock() # 共享变量count锁
def __init__(self, hicon, LC, AC):
self.LC=LC
... |
task_manager.py | from multiprocessing import Process, Queue, current_process
from enum import Enum
from tqdm import tqdm
from collections import defaultdict
import json
import tweepy
import os
import queue
import pickle
sid = -1
tfp = ""
class TaskType(Enum):
"""
This defines the types of tasks that the TaskManager can perfor... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
from weakref import proxy
import contextlib
imp... |
background.py | # Copyright 2018 Datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
DockerRunner.py | import docker
import os
import json
from threading import Thread
from time import time as _time
from time import sleep as _sleep
import sys
class DockerRunner:
"""
This class provides the container interface for Docker.
"""
def __init__(self, logger=None):
"""
Inputs: config dictiona... |
trainer.py | # Lint as: python3
# Copyright 2018 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 ... |
pretrained.py | # Copyright 2017-2021 John Snow Labs
#
# 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... |
test_add_image_progress.py | '''
New Integration test for add image progress.
@author: quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import zsta... |
message_server.py | # Copyright 2017 Google Inc. All rights reserved.
# Use of this source code is governed by the Apache 2.0 license that can be
# found in the LICENSE file.
import Queue
import logging
import threading
import time
import tornado.ioloop
import tornado.web
MESSAGE_SERVER = None
BLANK_PAGE = """<html>
<head>
<title>Blank<... |
wait_for_tests.py | #pylint: disable=import-error
from six.moves import queue
import os, time, threading, socket, signal, shutil, glob
#pylint: disable=import-error
from distutils.spawn import find_executable
import logging
import xml.etree.ElementTree as xmlet
import CIME.utils
from CIME.utils import expect, Timeout, run_cmd_no_fail, sa... |
test_html.py | from functools import partial
from importlib import reload
from io import BytesIO, StringIO
import os
import re
import threading
from urllib.error import URLError
import numpy as np
from numpy.random import rand
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserError
import p... |
tabuadapipe.py | import sys
import os
from multiprocessing import Process, Value, Array, Pipe
argm = int(sys.argv[1])
pipe_pai, pipe_filho = Pipe()
def func_tab(pipe_filho):
ar2 = pipe_filho.recv()
for i in range(11):
sm = argm * i
ar2.append(sm)
pipe_filho.send(ar2)
ar2 = []
newT = Proces... |
fib.py | import time
import multiprocessing
def profile(func):
def wrapper(*args, **kw):
import time
start = time.time()
func(*args, *kw)
end = time.time()
print('Cost:{}'.format(end-start))
return
return wrapper
def fib(n):
if n <= 2:
return n
return fi... |
hid_reader.py | import selectors
import threading
from datetime import datetime
import evdev
from evdev import InputDevice, categorize, ecodes
from app.readers.exceptions import ReaderNotFound
from app.readers.nfc.cards.mifare_classic import MifareClassicCard
from app.readers.port import Port
from app.utils.time import utc_now
SCAN... |
augment.py | import os
import xml.etree.ElementTree as ET
import numpy as np
import cv2
import sys
from tqdm import tqdm
from albumentations import *
from multiprocessing import Process
classes = ["0","1","0head","1head"]
imageFolder = "images"
annotationFolder = "annotations"
if len(sys.argv) < 2:
quit()
wd = sys.argv[1]
... |
camera.py | import time
import io
import threading
import datetime
import cv2
import imutils
import time
import picamera
import picamera.array
from feed import app
def generate_feed(camera):
while True:
frame = camera.get_frame()
yield (b'--frame\r\n'
b'Content-Type: image/png\r\n\r\n' + frame... |
pixivwallpaper_gui.py | from uuid import getnode
import hashlib
import webbrowser
import tkinter as tk
import set_wallpaper
import time
import threading
import os
import subprocess
import win32com.client
import win32pdhutil
from threading import Timer
import psutil
url="https://singf.space/pixiv/controls/ranking"
def launch_picker():
u... |
word2vec.py | # Copyright 2015 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... |
slave_sup_sec.py | import time, random
import hashlib
import socket # Import socket module
import threading
import sys
from itertools import chain, product
import time
#p=21 q=109 n=2289 e=7 d=1543
def encrypt(data):
e,n=7,2289
#print("encrypting : "+data)
intdata = [x for x in map(ord, data)]
crypteddata... |
test_shell_interactive.py | #!/usr/bin/env impala-python
# encoding=utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... |
test_comms.py | import asyncio
import types
from functools import partial
import os
import sys
import threading
import warnings
import pkg_resources
import pytest
from tornado import ioloop
from tornado.concurrent import Future
import distributed
from distributed.metrics import time
from distributed.utils import get_ip, get_ipv6
fr... |
middleman.py | import workman
import configparser
import time
import threading
from database import init_engine, db_session
from models import Scan
class Middleman:
def __init__(self):
self.config = configparser.ConfigParser()
self.config.read('config.ini')
self.max_scans = int(self.config["WEBAUDIT"]["M... |
telemetry.py | '''fonty.lib.telemetry'''
import sys
import json
import platform
import threading
from enum import Enum
from datetime import datetime
from typing import Tuple
import requests
from fonty.version import __version__
from fonty.lib.json_encoder import FontyJSONEncoder
from fonty.lib.constants import TELEMETRY_ENDPOINT, JS... |
scheduler.py | import sys
import traceback
if sys.version_info[0] < 3:
import Queue as queue
else:
import queue
import threading
from yaku.task_manager \
import \
run_task, order_tasks, TaskManager
from yaku.utils \
import \
get_exception
import yaku.errors
def run_tasks(ctx, tasks=None):
if task... |
server.py | # Adafruit BNO055 WebGL Example
#
# Requires the flask web framework to be installed. See http://flask.pocoo.org/
# for installation instructions, however on a Linux machine like the Raspberry
# Pi or BeagleBone black you can likely install it by running:
# sudo apt-get update
# sudo apt-get install python-pip
# su... |
index.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
from threading import Thread
from distlib import Dist... |
postproc.py | #!/usr/bin/python -OO
# Copyright 2007-2019 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later... |
adb-d8.py | #!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Runs an android build of d8 over adb, with any given arguments. Files
# requested by d8 are transferred on-demand from the caller,... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
meraki_captive_portal_simulator.py | """
Cisco Meraki Captive Portal simulator
Default port: 5003
Matt DeNapoli
2018
https://developer.cisco.com/site/Meraki
"""
# Libraries
from flask import Flask, request, render_template, redirect, url_for
import random
import datetime
import time
import requests
import webview
import netifaces as nif
import dateti... |
Hiwin_RT605_ArmCommand_Socket_20190627180740.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
Client.py | from tkinter import *
import tkinter.messagebox
from PIL import Image, ImageTk
import socket, threading, sys, traceback, os
from RtpPacket import RtpPacket
CACHE_FILE_NAME = "cache-"
CACHE_FILE_EXT = ".jpg"
class Client:
INIT = 0
READY = 1
PLAYING = 2
state = INIT
SETUP = 0
PLAY = 1
PAUSE =... |
server.py | """RPC server implementation.
Note
----
Server is TCP based with the following protocol:
- Initial handshake to the peer
- [RPC_MAGIC, keysize(int32), key-bytes]
- The key is in format
- {server|client}:device-type[:random-key] [-timeout=timeout]
"""
from __future__ import absolute_import
import os
import ctypes... |
ui_utils.py | # -*- coding: utf-8 -*-
import os
import platform
import re
import subprocess
import sys
import textwrap
import threading
import time
import tkinter as tk
import tkinter.font
import traceback
from logging import getLogger
from tkinter import filedialog, messagebox, ttk
from typing import Callable, List, Optional, Tuple... |
parmap_queue.py | #coding=utf-8
from multiprocessing import Queue, Process, cpu_count
def fib(n):
if n<= 2:
return 1
return fib(n-1) + fib(n-2)
def apply_func(f, q_in, q_out):
while not q_in.empty():
i, item = q_in.get()
q_out.put((i, f(item)))
def parmap(f, items, nprocs=cpu_count()):
q_in,... |
launch.py | import threading
import time
import enquiries
import os
import sys
import re
import math
import multiprocessing
from src.components.server.server import Server
from src.components.client.client import Client
from src.core.utils.configuration import Configuration
from src.protocol.base import Message
from src.protocol.... |
vm_service_test.py | # TODO: Unused Code
# Might use it later for VM case
"""
actions_lock = threading.Lock()
NodeSMPCAction = namedtuple("NodeSMPCAction", ["node_lock", "smpc_actions"])
actions_to_run_per_node: Dict[Any, NodeSMPCAction] = defaultdict(
lambda: NodeSMPCAction(threading.Lock(), deque())
)
def consume_smpc_actions_round... |
SocketPoller.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import socket
import select
import threading
import time
import datetime
from enum import Flag
#from threading import Lock
from Utils import DebugLock as Lock
from Utils import Utils
try:
from Event import Event
except Exception as ex:
Utils.... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
... |
test.py | import json
import pytest
import random
import re
import string
import threading
import time
from multiprocessing.dummy import Pool
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
node1 = cluster.a... |
DataTransformer_local_onlineExpert.py |
import csv
import os
import sys
import shutil
import time
import numpy as np
import scipy.io as sio
import yaml
from easydict import EasyDict
from os.path import dirname, realpath, pardir
from hashids import Hashids
import hashlib
sys.path.append(os.path.join(dirname(realpath(__file__)), pardir))
import utils.graphU... |
error_handling.py | # Copyright 2018 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... |
pose_observer.py | import rospy
from std_msgs.msg import Header
from geometry_msgs.msg import Pose, PoseStamped, Point, Quaternion
import threading
import tf2_ros
import tf2_geometry_msgs
import time
from .observer import Observer
class PoseObserver(Observer):
identical_pose = PoseStamped(
header=Header(frame_id="map"),
... |
IsaacGym.py | from utils.config import set_seed, get_args, parse_sim_params, load_cfg
from utils.parse_task import parse_task
import numpy as np
import torch # import torch after isaacgym modules
import multiprocessing as mp
"""
run the following code in bash before running.
export LD_LIBRARY_PATH=/xfs/home/podracer_steven... |
test_async.py | import os
import pytest
import threading
from smbclient import (
register_session,
open_file
)
def read_in_chunks(file_object, chunk_size=10 * 1024 * 1024):
while True:
data = file_object.read(chunk_size)
if not data:
break
yield data
def write_to_file(local_dir, re... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
server.py | """
rpyc plug-in server (threaded or forking)
"""
import sys
import os
import socket
import time
import threading
import errno
import logging
try:
import Queue
except ImportError:
import queue as Queue
from rpyc.core import SocketStream, Channel, Connection
from rpyc.utils.registry import UDPRegistryClient
from... |
test_all.py | #! /usr/bin/env python3
"""Brute-force test script: test libpqxx against many compilers etc.
This script makes no changes in the source tree; all builds happen in
temporary directories.
To make this possible, you may need to run "make distclean" in the
source tree. The configure script will refuse to configure other... |
server.py | #########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
controller_server.py | # Copyright (c) 2019 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 appli... |
a3d709a60f053fd06c281db96aef18fa5ac2808dTwistedThreadPool.py | import twisted.python.threadable as threadable
import twisted.python.threadpool as threadpool
import repository.persistence.Repository as Repository
import Queue
threadable.init()
class RepositoryThreadPool(threadpool.ThreadPool):
"""
An extension of the Twisted Thread Pool class that leverages
a C{... |
demo.py |
from ramp_server import Partition, RAMPAlgorithm
from ramp_client import Client
from random import sample, random, choice
from string import ascii_uppercase
from threading import Semaphore, Thread
# RAMPAlgorithm.{Fast, Small, Hybrid}
ALGORITHM = RAMPAlgorithm.Fast
NUM_PARTITIONS = 5
NUM_CLIENTS = 5
NUM_TXNS = 1000... |
performance_test_with_sqlalchemy.py | #!/usr/bin/env python
#
# 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.0OA
#
# Authors:
# - Wen Guan, <wen.guan@cern.ch>, 2019
"""
performance test... |
cas.py | from __future__ import print_function
from couchbase.bucket import Bucket
from couchbase.bucket import LOCKMODE_WAIT
from threading import Thread
from couchbase.exceptions import KeyExistsError
cb = Bucket('couchbase://10.0.0.31/default', lockmode=LOCKMODE_WAIT)
cb.upsert('a_list', [])
print('Will attempt concurr... |
test_process_utils.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... |
network.py | # Electrum - Lightweight Bitcoin Client
# 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 rig... |
infoblitzd.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import base64
import json
import logging
import logging.config
import logging.config
import os
import re
import socket
import socketserver
import subprocess
import sys
import threading
import time
import urllib.parse
from datetime import timedelta
from http import HTTPSta... |
e2elive.py | #!/usr/bin/env python3
#
import atexit
import glob
import gzip
import io
import json
import logging
import os
import random
import shutil
import sqlite3
import subprocess
import sys
import tempfile
import threading
import time
import urllib.request
from util import xrun, atexitrun, find_indexer, ensure_test_db, first... |
plugin.py | # -*- coding: utf-8 -*-
import json
import logging
import time
import threading
import zmq
from lucena.io2.networking import create_pipe
logger = logging.getLogger(__name__)
class Plugin(object):
def __init__(self, zmq_context):
self.zmq_context = zmq_context
self.poller = zmq.Poller()
... |
active_object.py | import string
import time
import random
from concurrent.futures import ThreadPoolExecutor, wait
from queue import Queue
from threading import Thread
from typing import Any
class Websocket:
""" Execution class """
def __init__(self):
self.run = True
self.queue = Queue() # List of pending requ... |
presence.py | from __future__ import unicode_literals
from logging import disable
from threading import Thread
import time
from typing import Optional
import humanfriendly
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from octoprint_discordremote import DiscordRemotePlugin
from octoprint_discordremote import DiscordI... |
demo7.py | # -*- coding:utf-8 -*-
# @Time : 2019/10/10 17:26
# @Author : Dg
from multiprocessing import Manager, Process, Lock
import os
m = 0
def work(n, lock=None):
# with lock: #不加锁而操作共享的数据,肯定会出现数据错乱
global m
m += 1
print(m)
if __name__ == '__main__':
lock = Lock()
p_l = []
n = 0
for i i... |
main.py | #!/usr/bin/env python3
import csv
import threading
import time
from pathlib import Path
import blobconverter
import cv2
import depthai as dai
import numpy as np
# Get argument first
# Start defining a pipeline
pipeline = dai.Pipeline()
# Define a source - color camera
cam_rgb = pipeline.createColorCamera()
cam_rgb.s... |
fan_logic.py | import time, logging, json, schedule, threading
import thermostat_database, thermostat_controller, config
# Setup logging
l = logging.getLogger(__name__)
query_db = thermostat_database.query_db
get_info = thermostat_controller.get_info
thermostat_control = thermostat_controller.thermostat_control
def set_fan_state(... |
xcvrd.py | #!/usr/bin/env python2
"""
xcvrd
Transceiver information update daemon for SONiC
"""
try:
import ast
import copy
import functools
import json
import multiprocessing
import os
import signal
import sys
import threading
import time
from sonic_py_common import daemon_b... |
MainFrame.py | # -*- coding: utf-8 -*-
#
import os
import sys
import wx
import threading
from form.panel.FilePanel import FilePanel
from form.panel.ParamPanel import ParamPanel
from form.panel.ParamAdvancePanel import ParamAdvancePanel
from form.panel.ParamBonePanel import ParamBonePanel
from utils import MFormUtils, MFileUtils # no... |
testing.py | """
Contains testing infrastructure for QCFractal.
"""
import os
import pkgutil
import shutil
import signal
import socket
import subprocess
import sys
import threading
import time
from collections import Mapping
from contextlib import contextmanager
import numpy as np
import pandas as pd
import pytest
import qcengine... |
tracer.py | from bcc import BPF
import socket
import os
import seccompGenerator
import time
import threading
import grpc
from concurrent import futures
import service_pb2
import service_pb2_grpc
pathModules="modules.c"
pathSyscalls="syscalls.txt"
fileDesc={}
def load_modules():
with open(pathModules, "r") as f:
mo... |
multitester.py | """
Certbot Integration Test Tool
- Configures (canned) boulder server
- Launches EC2 instances with a given list of AMIs for different distros
- Copies certbot repo and puts it on the instances
- Runs certbot tests (bash scripts) on all of these
- Logs execution and success/fail for debugging
Notes:
- Some AWS ima... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.