source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a bitcoind node can load multiple wallet files
"""
from decimal import D... |
parallel_environment.py | import torch
from multiprocessing import Process, Pipe
from typing import List, Callable, Dict
import gym
def worker(conn, env_suppliers: list):
envs = [supplier() for supplier in env_suppliers]
while True:
cmd, data = conn.recv()
if cmd == "step":
conn.send([env.step(d) for env, ... |
pycli.py | #!/usr/bin/python3
"""Basic CLI in Python3"""
import threading as th
import time
cont=True
text=None
class InputThread:
def __init__(self):
global cont
global text
while True:
self.loop_thread()
time.sleep(1)
text=None
cont=True
def loo... |
main.py | from Config import config
from train import train
from test import testTools,getimg,getlabel_low
import numpy
from DATA import WaterDataset
import Networks
from torchvision import transforms as T
from torch.utils.data import DataLoader
from matplotlib import pyplot
import os
from PIL import Image
import time
import uti... |
test_errcodes.py | #!/usr/bin/env python
# test_errcodes.py - unit test for psycopg2.errcodes module
#
# Copyright (C) 2015 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software ... |
test_auto_scheduler_measure.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
buck.py | # Copyright 2004-present Facebook. All rights reserved.
# pyre-unsafe
import functools
import glob
import json
import logging
import os
import subprocess
import sys
import tempfile
import threading
from collections import namedtuple
from json.decoder import JSONDecodeError
from logging import Logger
from typing impo... |
scr_hlp.py | #!/usr/bin/env python3
# coding=UTF-8
import os
import shutil
import sys
import urllib.request
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from usernames import Users, CustomException
from threading import Thread
def save_current_page(html... |
automating_vdr_form.py | """
'Automated VDR' Program v1.0, Copyright 2017 Sam Suri, all rights reserved. Only use with permission.
This program uses live data from BSD and updates it in VAN's My Campaign universe. Use only after running
"'Automated ALL' CSV Test Program," which ensures that corrupted data is not being passed into VAN.
... |
test_engine.py | import asyncio
import time
from functools import partial
from threading import Thread
import pytest
from pnp.engines import AsyncEngine, NoRetryHandler
from pnp.models import TaskModel, PullModel, PushModel
from pnp.plugins.pull.simple import Count
from pnp.plugins.push.simple import Echo
def _run_engine(engine, ta... |
__init__.py | import os
from flask import Flask, request
from source.node import Node, getId, BootstrapNode
#router stuff
import requests
import json
import numpy as np
from source.lib import merge_dict
from source.message import *
import time
import pathlib
import threading
def create_app(test_config=None):
# create and conf... |
dmf_device_controller.py | from concurrent.futures import ThreadPoolExecutor
import logging
import pkg_resources
import pkgutil
import threading
import time
from markdown2pango import markdown2pango
from microdrop_device_converter import convert_device_to_svg
from microdrop_utility.gui import yesno
from pygtkhelpers.gthreads import gtk_threadsa... |
progress_bar.py | import logging
import sys
from datetime import datetime, timedelta
from threading import Event, Thread
from typing import Any, Dict, Optional, Type
from tqdm.auto import tqdm
from mpire.comms import WorkerComms, POISON_PILL
from mpire.dashboard.connection_utils import (DashboardConnectionDetails, get_dashboard_connec... |
test_tracing.py | #!/usr/bin/env python
# Copyright (c) 2018-2019, Ivor Wanders
# All rights reserved.
#
# Redistribution and use 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
# ... |
draw_test.py | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... |
transitions.py | '''BalsamJob Transitions
The user selects ``NUM_TRANSITION_THREADS`` processes to run
alongside the main Launcher process. These are created with ``multiprocessing.Process``
and communicate with the Launcher through a ``multiprocessing.Queue`` (or a
PriorityQueue via a ``multiprocessing.managers.SyncManager``)
The t... |
gpsegwalrep.py | #! /usr/bin/env python
"""
Initialize, start, stop, or destroy WAL replication mirror segments.
============================= DISCLAIMER =============================
This is a developer tool to assist with development of WAL replication
for mirror segments. This tool is not meant to be used in production.
It is sug... |
multiprocesses.py | # Intro to Multiprocessing
# Multiple processes running the same script
# This is VERY different than threading
# Each process has its own memory space and its own threads
import logging
import multiprocessing
from multiprocessing import process
import time
import random
# Test function
def test(num... |
arpscan.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# scan network with arp requests
# copyright ¢ 2013 by Domen Ipavec
import interfaces, connection, arp
import threading, time
# scan network on interface ifname
def scan(ifname):
# get interface and addresses
interface = interfaces.findInterface(ifname)
mac_addresses = i... |
interpolate_rasters_func.py | #!/usr/bin/env python
#--------------------------------
# Name: interpolate_rasters_func.py
# Purpose: Interpolate ETrF rasters between Landsat scenes based on DOY
#--------------------------------
from __future__ import division
import argparse
from builtins import input
from collections import defaultdi... |
xla_device.py | # Copyright The PyTorch Lightning team.
#
# 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 i... |
http_server_test.py | #!/usr/bin/env python
"""Unittest for grr http server."""
import hashlib
import os
import socket
import threading
import ipaddr
import portpicker
import requests
import logging
from grr.client import comms
from grr.client.client_actions import standard
from grr.lib import action_mocks
from grr.lib import aff4
fro... |
tsumego.py | from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import Select
import time
import re
import rank
import threading
import points
GOOD = 1
BAD = 0
CONTINUE = 2
OTHER = 3
class Tsumego(object):
def __init__(self):
self.url = '... |
02_get_neighbors.py | import json
import requests
import threading
import queue
from requests.auth import HTTPBasicAuth
requests.packages.urllib3.disable_warnings()
# Declare devices to automate (inventory)
INV = {
"nxos-spine1": {
"device_type": "cisco_nxos",
"username": "ntc",
"password": "ntc123... |
benchmark.py | import os
from statistics import mean
import multiprocessing as mp
import numpy as np
import datetime
from frigate.edgetpu import LocalObjectDetector, EdgeTPUProcess, RemoteObjectDetector, load_labels
my_frame = np.expand_dims(np.full((300,300,3), 1, np.uint8), axis=0)
labels = load_labels('/labelmap.txt')
######
# M... |
mdns_example_test.py | import os
import re
import select
import socket
import struct
import subprocess
import time
from threading import Event, Thread
import dpkt
import dpkt.dns
import ttfw_idf
from tiny_test_fw import DUT
from tiny_test_fw.Utility import console_log
stop_mdns_server = Event()
esp_answered = Event()
esp_delegated_answered... |
train_abstractive.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import glob
import os
import random
import signal
import time
import torch
from pytorch_transformers import BertTokenizer
import distributed
from models import data_loader, model_builder
from models.data_loader i... |
zeromq_consumer.py | # -*- coding: utf-8 -*-
# @Author : ydf
import os
import socket
import json
# import time
import zmq
import multiprocessing
from funboost.consumers.base_consumer import AbstractConsumer
from nb_log import get_logger
# noinspection PyPep8
def check_port_is_used(ip, port):
s = socket.socket(socket.AF_INET, socket.... |
cors_misc.py | import os
from queue import Queue
from urllib.parse import urlparse
from threading import Thread
import requests
import threading
from requests import get
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
lock = threading.Lock()
... |
jsview_3d.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from libtbx.math_utils import roundoff
import traceback
from cctbx.miller import display2 as display
from cctbx.array_family import flex
from cctbx import miller, sgtbx
from scitbx import graphics_utils
from scitbx import matrix
im... |
archiver.py | import argparse
import errno
import io
import json
import logging
import os
import pstats
import random
import re
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import time
import unittest
from binascii import unhexlify, b2a_base64
from configparser import ConfigParser
from datetim... |
logging.py | import threading
import time
from logging.loggingTask import LoggingTask
class Logging(object):
def __init__(self,logic):
"""
Manages the LoggingTasks
:param logic: reference to the logic module
"""
self.lock = threading.Lock()
self.logic = logic
self.ui = N... |
plug.py | import paho.mqtt.client as mqtt
import time
import robonomicsinterface as RI
import json
import os
import typing as tp
import yaml
from substrateinterface import Keypair
import logging
import threading
logger = logging.getLogger(__name__)
logger.propagate = False
handler = logging.StreamHandler()
logger.addHandler(han... |
ModuleArpPosion.py | #The MIT License (MIT)
#Copyright (c) 2015-2016 mh4x0f P0cL4bs Team
#Permission is hereby granted, free of charge, to any person obtaining a copy of
#this software and associated documentation files (the "Software"), to deal in
#the Software without restriction, including without limitation the rights to
#use, copy, mo... |
sending_queue.py | import queue
from time import time, sleep
import threading
from telebot.apihelper import ApiException
import logging
MAX_MESSAGES_LIMIT = 30
PRIORITY = dict()
PRIORITY['repeat'] = 5
PRIORITY['normal'] = 10
PRIORITY['mailing'] = 20
class TextMessage:
def __init__(self, chat_id, text,
disable_web... |
camera11_depth.py | #detects the object
#gets the distance
#moves the eye until its in the middle
#receives and prints the angle in the main loop
#calculates the trig for the vert and horiz position of the detection
#receives mode from touchscreen remote
#allows mode switching
#publishes 2 different sets of vector 3 messages to move the a... |
fsmonitor.py | #!/usr/bin/python
# a small program to test the possibilities to monitor the file system and
# log changes on Windowsm Linux, and OSX
#
# Originally written by Christoph Gohle (2010)
# Modified by Gene Horodecki for Windows
# Further modified by Benjamin Pierce
# should be distributed under GPL
import sys
import os
i... |
vision_ex.py | import numpy as np
import cv2
import cv2.aruco as aruco
#from aruco_lib import *
import pyrealsense2 as rs
import copy
import threading
from datetime import datetime
import sys, time
import keyboard
from threading import Timer
import socket
import struct
import random
from datetime import datetime
from ctypes import ... |
common.py | """Test the helper method for writing tests."""
from __future__ import annotations
import asyncio
import collections
from collections import OrderedDict
from collections.abc import Awaitable, Collection
from contextlib import contextmanager
from datetime import datetime, timedelta
import functools as ft
from io import... |
make_freq_lexicons.py | import time
import random
import constants
import seeds
import util
import polarity_induction_methods
from historical import vocab
from multiprocessing import Queue, Process
from queue import Empty
from representations.representation_factory import create_representation
"""
Makes historical sentiment lexicons for non... |
python_ls.py | # Copyright 2017 Palantir Technologies, Inc.
from functools import partial
import logging
import os
import socketserver
import threading
from pyls_jsonrpc.dispatchers import MethodDispatcher
from pyls_jsonrpc.endpoint import Endpoint
from pyls_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter
from . imp... |
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... |
parallelizer.py | # Copyright 2020 Jacob D. Durrant
#
# 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 writ... |
local_worker.py | import os
import sys
import subprocess
import argparse
import json
import psutil
import time
import six
from pygtail import Pygtail
import threading
from apscheduler.schedulers.background import BackgroundScheduler
from . import fs_tracker, model, logs
from .local_queue import LocalQueue
from .gpu_util import get_ava... |
test_github.py | import logging
from threading import Thread
from unittest import TestCase
from parameterized import parameterized
from hvac import exceptions
from tests import utils
from tests.utils.hvac_integration_test_case import HvacIntegrationTestCase
from tests.utils.mock_github_request_handler import MockGithubRequestHandler
... |
test_win32file.py | import unittest
from pywin32_testutil import str2bytes, TestSkipped, testmain
import win32api, win32file, win32pipe, pywintypes, winerror, win32event
import win32con, ntsecuritycon
import sys
import os
import tempfile
import threading
import time
import shutil
import socket
import datetime
import random
import win32tim... |
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... |
populations.py | #!/usr/bin/env python
"""
Population class
"""
import itertools
from typing import List
import numpy as np
from tqdm.auto import tqdm
import multiprocessing as mp
def _tqdm_listener(queue: mp.Queue, total: int, desc: str, unit: str):
"""
a process to start a tqdm and update it whenever a message on queue ... |
web_service.py | # Copyright (c) 2020 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... |
run_designs.py | #!/usr/bin/env python3
# Copyright 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
import selectors
import sysconfig
import select
import shutil
import threading
import gc
import textwrap
import jso... |
statemine_monitor.py | import logging
import threading
import typing as tp
from substrateinterface import SubstrateInterface
# set up logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s: %(message)s",
)
class ACTIncomeTracker:
"""
Income tracker of ACT in Statemine Kusama parachain
"""
... |
admin_command.py | import logging
import os
import sys
import threading
import time
from bot.video_bot import updater
from . import restrict_access
# This needs to be run on a new thread because calling 'updater.stop()' inside a
# handler (shutdown_cmd) causes a deadlock because it waits for itself to finish
def shutdown():
update... |
dft_if_signal.py | #
# Copyright (c) 2019, Manfred Constapel
# This file is licensed under the terms of the MIT license.
#
#
# DFT of IF signal plot (per frame, from memory dump of Capture Demo)
#
import os
import sys
import threading
import time
try:
import numpy as np
import matplotlib as mpl
import matplotl... |
__init__.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... |
worker.py | import logging
import threading
logger = logging.getLogger('[WORKER]')
logger.setLevel(logging.INFO)
__author__ = 'Andres'
'''
This class simplifies thread usage. Examples:
1 - Worker.call(aFunction).withArgs(arg1, arg2..argN).start() / Runs a normal thread starting at aFunction
2 - Worker.call(aFunction).withArg... |
test_eap_proto.py | # EAP protocol tests
# Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import hashlib
import hmac
import logging
logger = logging.getLogger()
import os
import select
import struct
import threading
i... |
consumers.py | from channels.generic.websocket import WebsocketConsumer
from . import _js_functions, _websockets, _import_js_function, \
_mock_queue_done, _mock_queue, _process_message, \
_on_close_callback, sleep
import json as jsn
import threading
class EelConsumer(WebsocketConsumer):
def connect(self):
global _webso... |
base.py | import json
import threading
from typing import Dict
from src import config
from src.libs import utils, app_logger
from src.libs.cache import redis_cache
from src.viz_models import pb_reader
class BaseModel:
def __init__(self, user_id: str, repo_id: str, branch_id: str):
self.user_id = user_id
se... |
__init__.py | import logging
from pprint import pformat
from threading import Thread
from .. import matrices
from ..hass import HomeAssistant
logger = logging.getLogger(__name__)
def clamp_value(value, range_):
return min(max(value, range_.start), range_.stop)
class BaseComponent:
MATRIX = matrices.ERROR
def __ini... |
RANSOMWARE.py | from cryptography.fernet import Fernet
import os
import webbrowser
import ctypes
import urllib.request
import requests
import time
import datetime
import subprocess
import win32gui
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES, PKCS1_OAEP
import threading # used for ransom note and decryption key on d... |
test_util_test.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... |
sdk.py | # -*- coding: utf-8 -*
# Copyright (C) 2018 Kin Foundation
from decimal import Decimal, getcontext
from functools import partial
from stellar_base.keypair import Keypair
from .config import *
from .errors import *
from .stellar.channel_manager import ChannelManager
from .stellar.horizon import Horizon, HORIZON_LIVE... |
pesa2.py | # This file is part of NEORL.
# Copyright (c) 2021 Exelon Corporation and MIT Nuclear Science and Engineering
# NEORL is free software: you can redistribute it and/or modify
# it under the terms of the MIT LICENSE
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# ... |
test_multiprocessing_env_run_env.py | import multiprocessing as mp
import numpy as np
import source.environment.multiprocessing_env as subprocess
import unittest
from unittest.mock import MagicMock, patch
def setup_test(num_processes, state, reward=0.0, done=False, info=None):
"""
Sets up num_processes processes and pipes
:param num_processe... |
__init__.py |
import collections
import inspect
import itertools
import pathlib
import sys
import threading
import time
try:
import ipywidgets
except ModuleNotFoundError:
pass
try:
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation
except ModuleNotFoundError:
pass
def _check_mod... |
main.py | import datetime, sys, itertools, threading, pandas as pd
def csv_to_xlsx():
file_input = "masterfile.CSV"
file_input = "E:\\folder download\\Telegram Desktop\\MASTERFILE-104.CSV"
file_output = "master.xlsx"
#file_output = pd.ExcelWriter("master.xlsx")
pd.read_csv(file_input,
... |
comm_autobahn.py | from __future__ import print_function
import logging
import threading
from autobahn.twisted.websocket import WebSocketClientFactory
from autobahn.twisted.websocket import WebSocketClientProtocol
from autobahn.twisted.websocket import connectWS
from autobahn.websocket.util import create_url
from twisted.internet impor... |
webcam2rgb.py | import cv2
import numpy as np
import threading
class Webcam2rgb():
def start(self, callback, cameraNumber=0, width = None, height = None, fps = None, directShow = False):
self.callback = callback
try:
self.cam = cv2.VideoCapture(cameraNumber + cv2.CAP_DSHOW if directShow else cv2.CA... |
Hiwin_RT605_ArmCommand_Socket_20190627194355.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... |
bazelci.py | #!/usr/bin/env python3
#
# Copyright 2018 The Bazel 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 ... |
ui.py | """Provides abstract and concrete UI classes
An abstract UI is defined that can be provided by either a CLI
interface or a QT interface. Both examples are provided
Classes:
* :class:`DICEAuthenticatorListener`
* :class:`DICEAuthenticatorUI`
* :class:`ConsoleAuthenticatorUI`
* :class:`QTAuthenticatorUI`
"""
"""
... |
array_multiprocess.py | import atsp, sys, multiprocessing as mp
#################
cores = 12 # how many threads you want to use? >=2
epoch = 50 # epoch takes more time but has better chance approaching to the best result.
regb = (0.3, 3) # regularization_bound for atsp
initf = 20 # initial fitness for multiprocessing, more fitness takes ... |
session_test.py | # Copyright 2015 Google 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 a... |
test_dota_base.py | # -*- coding:utf-8 -*-
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 tqdm
import argparse
from multiprocessing import Queue, Process
from utils import... |
server.py | import json
import os
import sys
import tempfile
import threading
import flask
from flask import Flask, jsonify, request
import chatbot.train
import config
import intents.intents
import sentences
path = os.getcwd()
# elevate.elevate()
app = Flask(__name__)
def check_api_key(actual_request):
token = actual_req... |
gmm.py | # Wang Yu, the University of Yamanashi, Japan
# Sep 27, 2020
import numpy as np
import scipy.cluster.vq as vq
import librosa
import threading
import time
import os,sys
DIR=os.path.dirname(os.path.dirname(__file__))
sys.path.append(DIR)
from feature import feature
def compute_mfcc_feat(filePath,sampleRate=16000,win... |
gm01server.py | import socket
import sys
import thread
import time
import datetime
import os
import threading
import subprocess
import logging
#logging.basicConfig(format="%(asctime)s %(message)s",level=logging.DEBUG)
logging.basicConfig(filename='system.log',format="%(asctime)s %(message)s",level=logging.DEBUG)
if no... |
semaphore_perf.py | from ibis.comms import IPCLock
import threading
class Counter:
def __init__(self):
self.total = 0
def inc(self):
self.total += 1
def run_test():
counter = Counter()
ceiling = 1000
master = IPCLock(is_slave=0)
slave = IPCLock(master.semaphore_id)
def ping():
whil... |
main_window.py | #!/usr/bin/env python3
#
# 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 with... |
vis.py | '''
vis.py - GPUE: Split Operator based GPU solver for Nonlinear
Schrodinger Equation, Copyright (C) 2011-2015, Lee J. O'Riordan
<loriordan@gmail.com>, Tadhg Morgan, Neil Crowley. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the fo... |
test_base_events.py | """Tests for base_events.py"""
import concurrent.futures
import errno
import math
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from test.test_asyncio import utils as test_util... |
servers.py | import ssl
import socket
import threading
from . import RequestMethod
from .requests import Request
# Server class
class Server:
def __init__(self, host, port, filedir):
self._host = host
self._port = port
self.filedir = filedir
@property
def host(self):
return self._host... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import logging
import... |
libgreen.py | #!/usr/bin/env python3
# libgreen, alpha release
# Copyright 2018, Aswin Babu Karuvally
# import the serious stuff
import os
import sys
import time
import socket
import ipaddress
import logging
import netifaces
import pathlib
import threading
import netaddr
import signal
import json
import ast
import base64
import pwd... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from electrum_dash.bitcoin import TYPE_ADDRESS
from electrum_dash.storage import WalletStorage
from electrum_dash.wallet import Wallet, InternalAddressCorruption
from electrum_dash.pa... |
MultiStickSSDwithUSBCamera_OpenVINO_NCS2.py | import sys
if sys.version_info.major < 3 or sys.version_info.minor < 4:
print("Please using python3.4 or greater!")
sys.exit(1)
import numpy as np
import cv2, io, time, argparse, re
from os import system
from os.path import isfile, join
from time import sleep
import multiprocessing as mp
try:
from armv7l.op... |
SoundConnector.py | import textwrap
from time import sleep
from typing import Any, Optional
import threading
from ev3dev2simulator.connection.ClientSocket import get_client_socket
from ev3dev2simulator.connection.message.SoundCommand import SoundCommand
# noinspection PyProtectedMember
from simpleaudio._simpleaudio import SimpleaudioErro... |
ProcessYcsbLog.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import copy
import gzip
from dateutil import tz
import jinja2
import logging
import argparse
import magic
import os
import re
import datetime
import locale
import cPickle
import bokeh.charts
from itertools import islice
import pdfkit
import pytz
import Util
import webcolor... |
Firee.py | import pygame as pg
from random import randint as r , choice as c
import threading
def mod( x ) :
if x < 0 : x*= -1
return x
pg.init()
Window_Width = pg.display.Info().current_w
Window_Height = pg.display.Info().current_h
Window = pg.display.set_mode((Window_Width, Window_Height) , pg.FULLSCREEN )
... |
ws.py | #!/usr/bin/env python3
# coding=utf-8
# requires https://pypi.python.org/pypi/websocket-client/
from excepthook import uncaught_exception, install_thread_excepthook
import sys
sys.excepthook = uncaught_exception
install_thread_excepthook()
# !! Important! Be careful when adding code/imports before this point.
# Our e... |
client.py | import socket
import sys
from threading import Thread
from datetime import datetime
host = 'localhost'
port = 6666
block_size = 1024
login_user = ''
def time():
time_hour = str(datetime.now().time().hour)
time_minute = str(datetime.now().time().minute)
current_time = time_hour + ':' + time_minute
re... |
app.py | #!/usr/bin/env python
import random
import flask
import gi
import multiprocessing
import io
import detect_tflite
import base64
import binascii
import time
import math
import argparse
gi.require_version('Gst', '1.0')
gi.require_version('GstApp', '1.0')
gi.require_version('GstVideo', '1.0')
from gi.repository import GObj... |
Desktop.py | import os, sys
parentPath = os.path.abspath("..")
if parentPath not in sys.path:
sys.path.insert(0, parentPath)
from widgets.Label import Label
from widgets.Image import Image
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GObject, Gdk
import datetime
import psutil
gi.require_version('N... |
define_external_forces.py | from PyQt5.QtWidgets import QWidget, QMessageBox
from .qt.define_external_forces import Ui_ExternalForces
from multiprocessing import Process, Queue
from . import draggableLine
from ._conv import _float
class define_exernal_forces(QWidget):
def __init__(self, *args, simulation=None, until=0):
super()._... |
subscribe_io.py | __all__ = ['flexible_distribute', 'FlexibleDistribute', 'to_admin', 'detach']
import csv
import threading
from uuid import uuid4
from BusinessCentralLayer.middleware.flow_io import FlowTransferStation
from BusinessCentralLayer.middleware.work_io import *
from BusinessCentralLayer.middleware.redis_io import RedisClien... |
test_host_connection_pool.py | # Copyright 2013-2016 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 writi... |
stockmarket.py | from __future__ import print_function
import random
import threading
import time
import Pyro4
class StockMarket(object):
def __init__(self, marketname, symbols):
self.name = marketname
self.symbolmeans = {}
for symbol in symbols:
self.symbolmeans[symbol] = random.uniform(20, 2... |
schedule.py | import time
from multiprocessing import Process
import asyncio
import aiohttp
try:
from aiohttp.errors import ProxyConnectionError,ServerDisconnectedError,ClientResponseError,ClientConnectorError
except:
from aiohttp import ClientProxyConnectionError as ProxyConnectionError,ServerDisconnectedError,ClientRespons... |
EMSL_dump.py | import os
import sys
import re
import time
try:
import sqlite3
except ImportError:
print "you maybe need libsqlite3-dev from the package manager"
print "and the recompile Python"
raise
from misc.collections import OrderedDict
def install_with_pip(name):
ins = False
d = {'y': True,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.