source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
worker.py | from __future__ import absolute_import
from cli.utils.models.task import Task
from cli.utils.services.task import TaskService
from threading import Thread
import json, importlib.util, requests
class Worker():
queue = None
store = None
interfaces = None
def __init__(self, queue, store):
self.queue =... |
proxy.py | import time
from threading import Thread
try:
import socketserver as SocketServer
import http.server as SimpleHTTPServer
except ImportError:
import SocketServer
import SimpleHTTPServer
ARCHIVE = []
def log_info(info):
print('-----------------------------------------------------')
print(' ... |
flask_rclpy.py | import rclpy
import signal
from rclpy.node import Node
from std_msgs.msg import String
import threading
from flask import Flask
class TestPublisher(Node):
def __init__(self):
super().__init__('test_publisher')
self.publisher = self.create_publisher(String, 'flask_pub_topic', 10)
self.subsc... |
3_join.py | from logging_utils import info, debug,PROCESS_FORMAT
import logging
import multiprocessing
from random import randint
from time import sleep
logging.basicConfig(level=logging.DEBUG, format=PROCESS_FORMAT)
def sai_hi(id) -> None:
info(f"Hi! I'm a new process with id = {id}")
sleep(5)
if __name__ == "__main__"... |
subproc.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# author: Guopeng Li
# created: 27 Aug 2008
from multiprocessing import Process
from functools import partial
import sys
from twisted.internet import reactor
from twisted.internet import protocol
from twisted.protocols import basic
exit_code = 0
def exit_process(code=0)... |
rebalance.py | #!/usr/bin/env python3
from pyln.client import Plugin, Millisatoshi, RpcError
from threading import Thread, Lock
from datetime import timedelta
from functools import reduce
import time
import uuid
plugin = Plugin()
plugin.rebalance_stop = False
def setup_routing_fees(plugin, route, msatoshi):
delay = plugin.cltv... |
direct.py |
#!/usr/bin/env python
"""
@package mi.instrument.teledyne.workhorse_adcp_5_beam_600khz.ooicore.test.direct
@file mi/instrument/teledyne/workhorse_adcp_5_beam_600khz/ooicore/test/direct.py
@author Carlos Rueda
@brief Simple program to read in and parse an incoming stream from the
instrument.
Usage examples:
dire... |
Client.py | import socket
import threading
nickname = ''
class Client:
def __init__(self, host, port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock = sock
self.sock.connect((host, port))
self.sock.send(b'1')
print('Welcome to chat room!')
nickn... |
PodiumApp.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
PodiumApp.py
PodiumApp extends PropApp.
'''
from constants import *
from PropApp import PropApp
from PropData import PropData
import os, re, threading, time, yaml
if USE_GPIO and os.path.isfile('/opt/vc/include/bcm_host.h'):
import RPi.GPIO as GPIO
import pygame... |
http.py | from io import BytesIO, StringIO
import fnmatch
import json
import os
import re
import tarfile
import threading
import random
from six.moves.socketserver import TCPServer
from six.moves.BaseHTTPServer import BaseHTTPRequestHandler
from vee.pipeline import pypi
# Global state is gross.
_host = '127.0.0.1'
_port = ra... |
ros_iot.py | #!/usr/bin/env python
# license removed for brevity
import cherrypy
import threading
import time
import serial
import rospy
from std_msgs.msg import *
nanoSerial = serial.Serial("/dev/iot", 9600)
sonic_value = '0'
config = {
'global' : {
'server.socket_host' : '0.0.0.0',
'server.socket_port' : 808... |
run.py | import sys
sys.path.append('./python')
import skyhook.common as lib
import skyhook.io
from skyhook.op.op import Operator
import io
import json
import torch.multiprocessing as multiprocessing
import numpy
import os, os.path
import random
import requests
import skimage.io, skimage.transform
import threading
import time
... |
test_util.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... |
CachedConverterTest.py | ##########################################################################
#
# Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import pdb
import sys
import types
import unittest
import subprocess
import textwrap
from test import support
# This little helper class is essential for testing pdb under doctest.
from test.test_doctest import _FakeInput
class PdbTestInpu... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
multi2.py | """
Use multiprocess anonymous pipes to communicate. Returns 2 connection
object representing ends of the pipe: objects are sent on one end and
received on the other, though pipes are bidirectional by default
"""
import os
from multiprocessing import Process, Pipe
def sender(pipe):
"""
send object to parent o... |
thread3b.py | # thread3b.py when thread synchronization is used
from threading import Lock, Thread as Thread
def inc_with_lock (lock):
global x
for _ in range(1000000):
lock.acquire()
x+=1
lock.release()
x = 0
mylock = Lock()
# creating threads
t1 = Thread(target=inc_with_lock , args=(mylock,), na... |
85_ipc_gil.py | from threading import Thread
import time
# Python的GIL是什么鬼,多线程性能究竟如何 http://cenalulu.github.io/python/gil-in-python/
# Python GIL全局解释器锁详解(深度剖析) http://c.biancheng.net/view/5537.html
def my_counter():
i = 0
for _ in range(100000000):
i = i + 1
return True
def main2():
thread_array = {}
sta... |
utils.py | import queue
import random
import socket
import time
from multiprocessing import Process
import gym
import numpy as np
import pyglet
from a2c.common.atari_wrappers import wrap_deepmind
from scipy.ndimage import zoom
# https://github.com/joschu/modular_rl/blob/master/modular_rl/running_stat.py
# http://www.johndcook... |
test_basic.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
from multiprocessing import Process
import os
import random
import re
import setproctitle
import s... |
__init__.py | # Copyright 2014 Christoph Reiter <reiter.christoph@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
import os
if os.name == "nt":
from quodlibet.plugins import Pl... |
bot.py | import random
import threading
import time
from slackclient import SlackClient
import follower
SLACK_BOT_TOKEN = None
BOT_ID = "U2X7SSN9F"
AT_BOT = "<@" + BOT_ID + ">"
slack_client = SlackClient(SLACK_BOT_TOKEN)
start_responses = ["Sure...go get coffee or something", "On it!", "Got it!", "Yes sir!", "Will tell you... |
ControlSystem.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Thomas Wester <twester@mit.edu> (2017 - 2018)
# Daniel Winklehner <winklehn@mit.edu> (2018 - )
#
# Code adapted from MIST1ControlSystem.py (Python 2/gtk3+ version)
import requests
import json
import timeit
import time
import threading
import queue
import ... |
AsynchronousSender.py | from .SenderBase import SenderBase
from threading import Lock, Thread
class AsynchronousSender(SenderBase):
"""An asynchronous sender that works in conjunction with the :class:`AsynchronousQueue`. The sender object will
start a worker thread that will pull items from the :func:`queue`. The thread will be creat... |
plot_demo.py | import argparse
import logging
import socketserver
import sys
import threading
import time
from google.protobuf import text_format
import numpy as np
from pyqtgraph.Qt import QtCore, QtGui
from cvra_studio.viewers.LivePlotter import LivePlotter
import messages
from log_udp_protobuf import parse_packet
def argparser(... |
runner.py | #!/usr/bin/env python3
# Copyright 2010 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.
"""This is the Emscripten test runner. To run ... |
worker.py | import queue
from threading import Lock
from threading import Thread
from time import sleep
from py42.exceptions import Py42ForbiddenError
from py42.exceptions import Py42HTTPError
from code42cli.errors import Code42CLIError
from code42cli.logger import get_main_cli_logger
class WorkerStats:
"""Stats about the ... |
server.py | """A Socket subclass that adds some serialization methods."""
import zlib
import pickle
import glob
import numpy as np
import zmq
import random
import logging
from options.train_options import TrainOptions
from multiprocessing import Process
from data.img_loder import data_gen, video_data_gen
logger = logging.getLo... |
email.py | from flask_mail import Message
from app import mail
from flask import render_template
from app import app
from threading import Thread
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=subject... |
benchmark.py | #!/usr/bin/python3
from termcolor import colored
from tabulate import tabulate
from threading import Thread
import time
import argparse
import sys
import errno
import os
import shutil
import subprocess
import signal
# Output directory for the downloaded files. Cleaned afterwards
# Be extra careful when changing that... |
reader.py | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
YOLO.py | #!/usr/bin/env python
import datetime
import sys
import threading
import time
import yaml
import mxnet as mx
from mxnet import gluon
from mxboard import SummaryWriter
# self define modules
from yolo_modules import yolo_gluon
from yolo_modules import yolo_cv
from yolo_modules import global_variable
from render_car im... |
speech_output.py | """
module for the speech output
@autor: wimmer, simon-justus
"""
from gtts import gTTS
import os
from threading import Thread
import subprocess
import pyttsx
class Speaker:
def __init__(self):
pass
def say_in_thread(self, msg):
say_thread = Thread(target=self.say, args=(msg,))
sa... |
client.py | import tkinter as tk
import numpy as np
from tkinter import messagebox
import tictactoe as ttt
import threading
import socket, select, string, sys
def createThread(func, arguments=None):
cThread = threading.Thread(target=func, args=arguments)
cThread.daemon = True # Program becomes able to exit even if many thread a... |
service.py | import threading
class Service:
def __init__(self):
self.threadRun = False
def start(self):
self.threadRun = True
threading.Thread(target=self.__run).start()
def stop(self):
self.threadRun = False
def __run(self):
while self.threadRun:
self.run()
... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
compare_Wchain_adam_1layers.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
importlib.reload(qtm.base)
importlib.reload(qtm.constant)
importlib.reload(qtm.onequbit)
importlib.reload(qtm.nqubit)
importlib.reload(q... |
aaimi_gpio.py | #!/bin/bash
# AAIMI GPIO 0.4
# Configure and use Raspberry Pi GPIO pins and Arduino pins from a web interface
###############
# Copyright (C) 2017 Anthony Hartup
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softwa... |
test_Websocket.py | import websocket
import threading
import time
def on_message(ws, message):
print(message)
def on_error(ws, error):
print(error)
def on_close(ws):
print("### closed ###")
def on_open(ws):
def run(*args):
for i in range(3):
time.sleep(1)
ws.send("Hello %d" % i)
... |
__init__.py | import socket
import threading
HTTP_OK = "HTTP/1.0 200 OK\n\n"
HTTP_NOT_FOUND = "HTTP/1.0 404 NOT FOUND\n\n"
class httpserver():
def __init__(self, host, port, loop):
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
... |
build_image_data.py | # Copyright 2016 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_sys.py | import unittest, test.support
from test.support.script_helper import assert_python_ok, assert_python_failure
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
import gc
import sysconfig
import locale
import threading
# count the number of test runs, used t... |
Hiwin_RT605_ArmCommand_Socket_20190627161353.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import math
import enum
pos_feedback_times = 0
mode_feedback_times = 0
msg_feedback = 1
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
i... |
Broker.py | #!/usr/bin/env python3
######################################################################################################
#
# Organization: Peter Moss Leukemia AI Research
# Repository: HIAS: Hospital Intelligent Automation System
#
# Author: Adam Milton-Barker (AdamMiltonBarker.com)
#
# Title: H... |
interface.py | from flask import Flask, render_template
import threading
app = Flask(__name__)
bot_name = "Vyper-Bot"
def run(url, name="Vyper-bot"):
bot_name = name
thread = threading.Thread(target=app.run, args=[url])
thread.daemon = True
thread.start() |
ls.py | # Anthony Tiongson (ast119) with assistance from Nicolas Gundersen (neg62)
# LS (a simplified load-balancing DNS server)
#
# resources:
# https://www.pythonforbeginners.com/system/python-sys-argv
# https://stackoverflow.com/questions/2719017/how-to-set-timeout-on-pythons-socket-recv-method
# https://stackoverflow... |
builder.py | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2013 The Chromium OS Authors.
#
# Bloat-o-meter code used here Copyright 2004 Matt Mackall <mpm@selenic.com>
#
import collections
from datetime import datetime, timedelta
import glob
import os
import re
import Queue
import shutil
import signal
import string
import sy... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum
from electrum.bitcoin import TYPE_ADDRESS
from electrum import WalletStorage, Wallet
from electrum_gui.kivy.i18n import _
from electrum.paymentrequest import InvoiceStore
from electr... |
io.py | # Copyright 2018 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, ... |
amqp_client.py | import pika
from skyamqp.rpc import RPC_Server_Thread, RPC_Client_Thread
from skyamqp.queue import Queue_Server_Thread, Queue_Client_Thread
import threading
import uuid
import time
import logging
logger = logging.getLogger('skyamqp')
logger.setLevel(logging.WARNING)
class AMQP_Client:
__queueCmd__ = []
def __init_... |
Camera.py | """OpenCV Camera class setup and usage."""
from enum import Enum
from pathlib import Path
from threading import Event, Thread
from sys import platform
import time
try:
import cv2
from cv2 import aruco
except ImportError:
raise ImportError('ERROR opencv-contrib-python must be installed!')
class Camera(obj... |
spanprocessor.py | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
swayfader.py | from i3ipc import Connection, Event
from threading import Thread
from time import sleep
FRAME_T = 0.01 # time taken between each frame of fade
# transparency values
CON_AC = 1 # active window
CON_INAC = 0.8 # inactive window
FLOAT_AC = 1 # active floating window
FLOAT_INAC = 0.8 # inactive floating window
BOT_IN... |
tools.py | # -*- python-indent: 4 -*-
"""A few things that didn't seem to fit anywhere else."""
import os
import os.path
import pwd
import tempfile
import fcntl
import errno
import threading
import subprocess
import shutil
import sys
import signal
import logger
PID_FILE = '/var/run/nodemanager.pid'
####################
def... |
mission.py | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is licensed under the Apache Software License, v. 2 except as noted
# otherwise in the LIC... |
qiubai_queue.py | # coding=utf-8
import requests
from lxml import etree
import json
from queue import Queue
import threading
class QiuBai:
def __init__(self):
self.headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
... |
process.py | # -*- coding:utf-8 -*-
import os
import time
from multiprocessing import Process
def test(param):
for i in range(5):
print("multi process---%d---%s, pid---%d, ppid---%d" % (i, param, os.getpid(), os.getppid()))
time.sleep(1)
# Windows平台必须要添加if __name__ == '__main__':
# 否则会报:
'''
RuntimeError:
... |
user_agents.py | import logging
import threading
import time
from abc import ABC, abstractmethod
from threading import RLock
from typing import Dict, Optional, Callable, Tuple, Any
from cloud_controller.middleware import AGENT_HOST, AGENT_PORT, CLIENT_CONTROLLER_EXTERNAL_HOST, \
CLIENT_CONTROLLER_EXTERNAL_PORT, middleware_pb2 as m... |
http_server.py | import threading
import socket
import select
import os
from http.server import BaseHTTPRequestHandler, HTTPServer
# import SocketServer
from htun.tools import dump, temp_filename
from htun.args import args
SOCK_FILE_SERVER = temp_filename("/tmp/htun_s_")
SOCK_FILE_CLIENT = temp_filename("/tmp/htun_c_")
# data from... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet, InternalAddressCorruption
from electrum.paymentrequest import InvoiceStore
fr... |
top.py | """
TODO:
1. Refactor code so it's organized (now that I have an idea of what it'll do)
2. Add more sorting by changing stat dict to something that's easier to sort
"""
import os
import sys
import glob
import pickle
from decimal import Decimal
import time
from pprint import pprint
from os import system, name
fr... |
ipc.py | import contextlib
import logging
import random
import string
import threading
import unittest.mock
from typing import Callable, Optional
import rpyc
from loguru import logger
from rpyc.utils.server import ThreadedServer
from flexget import terminal
from flexget.log import capture_logs
from flexget.options import get_... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The BitcoinDX 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 bitcoindxd node can load multiple wallet files
"""
from decimal impo... |
main.py | # 2020
# The BlackEyeSecurity Toolkit was programmed and developed by Yasmijn.
# The BlackEyeSecurity Toolkit is published under the MIT Licence.
# The BlackEyeSecurity Toolkit is based on the CLIF-Framework.
# The CLIF-Framework is programmed and developed by Yasmijn.
# The CLIF-Framework is published under the MIT Li... |
server.py | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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... |
pyArduino.py | from threading import Thread
import serial
import time
import sys
class serialArduino:
def __init__(self,port,baud=9600,sizeData=1):
self.port = port
self.baud = baud
self.sizeData = sizeData
self.isReceiving = False
self.isRun = True
self.thread ... |
prueba_serial.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 31 08:13:13 2019
@author: BigBoss
"""
import serial, time, threading
def medir(x):
try:
while True:
y = x.readline().decode('utf-8')
#print(y.decode("ascii",end=""))
print(y)
except:
pass
x = serial.Serial("C... |
autologin1.py | import time
import pythoncom
from manuallogin import *
from PyQt5 import QtWidgets
from PyQt5.QtCore import QTimer
from multiprocessing import Process
from PyQt5.QAxContainer import QAxWidget
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.setting import OPENAPI_PATH
class Wi... |
test_process.py | # coding:utf-8
from __future__ import absolute_import, unicode_literals
from jspider.manager.deamon import Daemon
import multiprocessing
__author__ = "golden"
__date__ = '2018/6/26'
import time
import asyncio
async def task_async():
while True:
print('task async running')
await asyncio.sleep(1)
... |
host.py |
# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
import datetime
import logging
import os
import random
import sys
import time
from threading import Thread
from uuid import uuid4
from pymongo.collection import ReturnDocument
sys.path.append(os.path.join(os.path.dirname(__file__), ... |
object_detector.py | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Class definition and utilities for the object detection toolkit.
"""
from __futu... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
common.py | # Parallel Python Software: http://www.parallelpython.com
# Copyright (c) 2005-2012 Vitalii Vanovschi.
# Copyright (c) 2015-2016 California Institute of Technology.
# Copyright (c) 2016-2021 The Uncertainty Quantification Foundation.
# All rights reserved.
# Redistribution and use in source and binary forms, with or wi... |
test_clients_gateways.py | import asyncio
import copy
import multiprocessing
import time
from typing import Dict
import pytest
from jina import Document, DocumentArray
from jina.helper import random_port
from jina.parsers import set_gateway_parser
from jina.serve import networking
from jina.serve.runtimes.gateway.grpc import GRPCGatewayRuntime... |
ssh.py | #!/usr/bin/python
import getopt
import sys
from threading import Thread
from datetime import datetime
import uuid
sys.path = [".", "lib"] + sys.path
from remote.remote_util import RemoteMachineShellConnection
import TestInput
def usage(error=None):
print """\
Syntax: ssh.py [options] [command]
Options:
-p <key=... |
base.py | from .. import command, bar, configurable, drawer
import gobject
import logging
import threading
import exceptions
import warnings
LEFT = object()
CENTER = object()
class _Widget(command.CommandObject, configurable.Configurable):
"""
If width is set to the special value bar.STRETCH, the bar itself
... |
sample_bootstrap_blockchain.py | import sys, time
from threading import Thread
sys.path.insert(0, './../')
import PoP
import myGetMVP, myGetRating # function written by the user
import generator.matchGenerator as matchGen # test function to demonstrate library
# the nodeID config is already generated, please refer to sample_setup.py
nodeID = "Alice"
... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 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 cosantad shutdown."""
from test_framework.test_framework import BitcoinTestFramework
from test_framewo... |
test_lab.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
jobsmanager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Copyright (c) 2010-2020 Denis Machard
# This file is part of the extensive automation project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Le... |
work_queue.py | # -*- python -*-
# Mark Charney
#BEGIN_LEGAL
#
#Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
renderd.py | #!/usr/bin/python
#
# mod_tile rendering daemon example written in Python.
# The code is mostly a direct port of the C implementation.
#
# This is currently experimental and not intended as a replacement
# of the C implementation, but works surpringly well. It should be
# easier to produce custom variations of the rend... |
tb_device_mqtt.py | # Copyright 2021. ThingsBoard
#
# 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 ... |
thread_utils.py | import ctypes
def setthreadname(name): # pragma: no cover # we don't need tests for an esthetic feature
"""
Set a thread name.
The name of a thread cannot have more than 15 characters (bytes).
>>> from threading import Thread
>>> def set_my_name():
... import time
... setthreadna... |
__init__.py | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
AmbiGroup.py | # -*- coding: utf-8 -*-
import datetime
import os
import time
from threading import Thread, Event
import xbmc
import xbmcgui
from PIL import Image
from requests import ReadTimeout, ConnectionError
from urllib3.exceptions import MaxRetryError
from resources.lib import kodiHue, PROCESS_TIMES, cache, reporting, ADDONDIR... |
main.py | # -*- coding: utf-8 -*-
import sys
import time
import logging
from utils import get_parser, init_logging_handler
from datamanager import DataManager
# from user import UserNeural
# from usermanager import UserDataManager
from agenda import UserAgenda
from ppo_wm import PPO
from config import MultiWozConfig
from torch i... |
textviewer.py | from django.core.management.base import BaseCommand
from text_viewer.kiln_requester import CachedRequesterKiln
from text_viewer.text_viewer_tvof import TextViewerAPITvof
from collections import OrderedDict
class Command(BaseCommand):
help = 'Toolbox for the Text Viewer app'
def add_arguments(self, parser):
... |
plotly_app.py | """
Author: https://github.com/saewoonam
"""
import remi.gui as gui
from remi import start, App
import threading
import random
import time
import datetime
import json
class LabelSpinBox(gui.HBox):
def __init__(self, label='label', default_value=0,
min=0, max=100, step=1, labelWidth=100,
... |
module2.py | from twilio.rest import Client
from credentials import account_sid, auth_token, my_cell, my_twilio
import geocoder
import numpy
import os
import re
import pickle
import timeit
import glob
import cv2
from numpy import shape
from skimage import transform
import skimage
from skimage import io
from numpy import *
import sk... |
ops_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
logging.py | ################################################################################
# Copyright (C) 2019 drinfernoo #
# #
# This Program is free software; you can redistribute it and/or modify ... |
controller.py | import re
import time
from datetime import datetime
from threading import Thread
from typing import List, Set, Type
from bauh.api.abstract.controller import SoftwareManager, SearchResult, ApplicationContext
from bauh.api.abstract.disk import DiskCacheLoader
from bauh.api.abstract.handler import ProcessWatcher
from bau... |
detect.py | from datetime import datetime
import multiprocessing
from multiprocessing import Queue as MultiprocessingQueue
from multiprocessing import Lock
import numpy as np
from imlib.general.system import (
get_num_processes,
)
from cellfinder_core.detect.filters.plane.multiprocessing import (
MpTileProcessor,
)
from... |
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... |
script.py | import threading
import webbrowser
import os
import win32api
def runExe(path):
# fileName = os.path.basename(path)
# fileFolder = os.path.dirname(path)
# print(fi)
# x = os.popen('cd ' + fileFolder)
# print("-----------------")
# print(x.read())
# fileName = fileName.replace(".exe", "")... |
parallel_processing.py | class ParallelProcessing():
def __init__(self, function, iter, *args, **kwargs):
"""
This is a specialized wrapper around multiprocessing.Process object. It
launches multiple separate processes with the same input 'function' but different argument that comes from an iterable object like tupl... |
pub_sub_receive.py | """pub_sub_receive.py -- receive OpenCV stream using PUB SUB."""
import sys
import socket
import traceback
import cv2
from imutils.video import VideoStream
import imagezmq
import threading
import numpy as np
from time import sleep
# Helper class implementing an IO deamon thread
class VideoStreamSubscriber:
def ... |
run_mujoco_all.py | from baselines.trpo_mpi import run_mujoco
from baselines import bench, logger
from multiprocessing import Process
import numpy as np
def arg_parser():
"""
Create an empty argparse.ArgumentParser.
"""
import argparse
return argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.