source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
model-to-txt.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Jordi Mas i Hernandez <jmas@softcatala.org>
#
# This program 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 Foundation; either
# version 2.1 of... |
bitcoin_ticker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .. import bar
import base
import urllib
import urllib2
import gobject
import threading
try:
import json
except ImportError:
import simplejson as json
class BitcoinTicker(base._TextBox):
''' A bitcoin ticker widget, data provided by the MtGox API
... |
reterminal_node.py | # Copyright 2021 Borong Yuan
#
# 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, ... |
HiwinRA605_socket_ros_20190619135702.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
trex_wireless_worker.py | import cProfile
import io
import queue
import time
import traceback
import threading
import socket
import logging
import multiprocessing
import multiprocessing.connection
from concurrent.futures import ThreadPoolExecutor
import builtins
import simpy
from trex.common import *
from .logger import *
from .trex_wireless_a... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
import unittest.mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper
import sock... |
heartbeat.py |
import os
import time
import pprint
import signal
import threading as mt
from .misc import as_list
from .logger import Logger
# ------------------------------------------------------------------------------
#
class Heartbeat(object):
# ------------------------------------------------------------------------... |
demo.py | import logging
import random
import threading
import time
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s (%(threadName)-2s) %(message)s',
)
class ActivePool(object):
def __init__(self):
super(ActivePool, self).__init__()
self.active = []
... |
thread3.py | import threading
import time
# Exemplo de sincronização de threads com passagem de parametros:
# declaramos uma lista e declaramos duas funções, contador 1 e contador 2 ambos recebem parametros, faz um for ate o numero passado em parametro.
# printa o indice, e adiciona dentro da lista, time sleep, depois cria uma var... |
fn_api_runner.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
snow.py | '''
@Date: 2019-08-24 16:45:36
@LastEditors: Gravitykey
@LastEditTime: 2019-08-26 15:22:14
'''
# 实现一个8字节int之内的雪花算法
import time
import os
import threading
lock = threading.Lock()
class Snow(object):
def __init__(self, machine_idx=None):
init_date = time.strptime('2010-01-01 00:00:00', "%Y-%m-%d %H:%M:%S")
... |
test_execute.py | # pylint doesn't know about pytest fixtures
# pylint: disable=unused-argument
import os
import tempfile
from threading import Thread
from unittest import mock
import pytest
from dagster import (
CompositeSolidExecutionResult,
PipelineExecutionResult,
SolidExecutionResult,
execute_pipeline,
execute... |
paperclock.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright 2020 Oleksiy Voronin
#
# 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
... |
webtrader.py | # coding: utf-8
import logging
import os
import re
import time
from threading import Thread
import requests
from . import exceptions
from . import helpers
from .log import log
# noinspection PyIncorrectDocstring
class WebTrader(object):
global_config_path = os.path.dirname(__file__) + '/config/global.json'
... |
__init__.py | import unittest
import os
import logging as log
import random
import psutil
import string
import os, time
import sys
from multiprocessing import Process
VERBOSITY = 2
HERE = os.path.abspath(os.path.dirname(__file__))
class TestCase(unittest.TestCase):
# Print a full path representation of the single unit tests
... |
threadingtest.py | import threading
def worker(num):
"""thread worker function"""
print("worker: ",num)
return None
threads=[]
for i in range(5):
t=threading.Thread(target=worker,args=(i,))
print("i=",i)
threads.append(t)
t.start()
print("end")
|
subproc_vec_env.py | import multiprocessing
from collections import OrderedDict
import gym
import numpy as np
from stable_baselines.common.vec_env.base_vec_env import VecEnv, CloudpickleWrapper
from stable_baselines.common.tile_images import tile_images
def _worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
e... |
__get_auth__.py | import sys
import os
import paramiko
import itertools
import threading
import time
from configparser import ConfigParser
from config import Config
from prompt_toolkit import prompt
from prompt_toolkit.history import FileHistory
from colored import fg, bg, attr
from pathlib import Path
home = str(Path.home())
config_pa... |
scan_logfile_parallel.py | from __future__ import print_function
import boto3
import sys
import time
import threading
from multiprocessing import Queue
from lab_config import boto_args
queue = Queue()
def parallel_scan(tableName, totalsegments, threadsegment):
dynamodb = boto3.resource(**boto_args)
table = dynamodb.Table(tableName)
... |
test_sanity_sample.py | """
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
Unless required by applicable law or agreed to in writin... |
capteha_api.py | #!/usr/bin/env python3
# Fridosleigh.com CAPTEHA API - Made by Krampus Hollyfeld
# this is a modified version of the demo given by Chris Davis
# we load from base64 instead of memory & don't cap threads as we're doing GPU processing.
# Also to get it to work in time I had to use the mobilenet 224 quantized version (ns... |
uploader.py | #!/usr/bin/env python3
import glob
import sys
import threading
from time import sleep
from getpass import getpass
from typing import List
import click
import serial
active = True
socket = None
ready = False
shutdown = False
def check_script(fname: str) -> bool:
data = open(fname).read().splitlines()
main_ch... |
TTS.py | from loguru import logger
import time
import multiprocessing
# Real Time Voice Cloning
from encoder.params_model import model_embedding_size as speaker_embedding_size
from utils.argutils import print_args
from utils.modelutils import check_model_paths
from synthesizer.inference import Synthesizer
from encoder import i... |
train.py | # Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016
"""Train"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os.path
import sys
import time
import math
import numpy as np
from six.moves import xrange
import tensorf... |
window_server.py | import logging
import math
import traceback
from enum import Enum
from threading import Thread
import cv2
import numpy as np
import pywintypes
import win32gui
from PIL import ImageGrab
from win32api import GetSystemMetrics
from fishy.helper.config import config
class Status(Enum):
CRASHED = -1
STOPPED = 0
... |
Server.py | import socket
import threading
import socket
import random
import struct
from time import sleep
from colorama import Fore, Style
from scapy.arch import get_if_addr
class Server:
MAGIC_COOKIE = 0xfeedbeef
TYPE = 0x2
UDP_PORT = 13117
server_port = 101
# IP=get_if_addr('eth1')#'172.18.0.101'
# T... |
discrete_DPPO.py | """
A simple version of OpenAI's Proximal Policy Optimization (PPO). [https://arxiv.org/abs/1707.06347]
Distributing workers in parallel to collect data, then stop worker's roll-out and train PPO on collected data.
Restart workers once PPO is updated.
The global PPO updating rule is adopted from DeepMind's paper (DPP... |
NGINXApiModule.py |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from multiprocessing import Process
from gevent.pywsgi import WSGIServer
import subprocess
import gevent
from signal import SIGUSR1
import requests
from flask.logging import default_handler
from typing import Any, Dict... |
common.py |
import os
import re
import six
import subprocess
import sys
import tempfile
import textwrap
import threading
import unittest
_stdout_encoding = "utf-8"
if getattr(sys.stdout, "encoding", ""):
_stdout_encoding = sys.stdout.encoding
class ExecuteError(Exception):
def __init__(self, cmd, returnCode, stdout, st... |
OldSolver.py | # Time-constrained solver for shift scheduling IP
import argparse
from multiprocessing import Process, Manager
import pulp as pl
import sys
import officeScheduler.PeopleAndSets as PAS
import officeScheduler.Parser as Parser
from officeScheduler.Schedule import Schedule
# TODO: redesign so Solver is a supe... |
client.py | import socket
from time import sleep, ctime
import threading
import json
from colorama import init, Fore, Style
import random
"""
Colorama's Constant
"""
init()
COLORS = [Fore.RED, Fore.GREEN, Fore.CYAN, Fore.LIGHTGREEN_EX, Fore.LIGHTBLUE_EX, Fore.LIGHTCYAN_EX,
Fore.LIGHTMAGENTA_EX, Fore.MAGENTA, Fore.YELLOW... |
support_RegExp_test.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
tuner.py | # Copyright 2019 Huawei Technologies Co., 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 agreed to... |
zmq01.py | # coding: utf-8
"""
ZeroMQ (PyZMQ) の REP-REQ パターンのサンプルです。
"""
import itertools as it
import multiprocessing as mp
import time
import zmq
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
class Sample(SampleBase):
_SERVERURL = 'tcp://*:5555'
_CLIENTURL = 'tcp://loc... |
streaming.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import httplib
from socket import timeout
from threading import Thread
from time import sleep
import urllib
from tweepy.models import Status
from tweepy.api import API
from tweepy.error import TweepError
from tweepy.utils import import_simple... |
songtc_ContigFilterServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, InvalidRequestError
from jso... |
smss.py | from bs4 import BeautifulSoup
from collections import OrderedDict
from colorama import init
from copy import deepcopy
from datetime import date, datetime
from glob import glob
from pathlib import Path
from random import randint
from urllib import request
import asyncio
import fileinput
import itertools
imp... |
test_executor.py | import argparse
import threading
import time
from depthai_demo import DepthAI
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--streams", nargs="+")
parser.add_argument("-cnn", "--cnn_model")
args = parser.parse_args()
dai = DepthAI()
thread = threadin... |
test_collection.py | # -*- coding: utf-8 -*-
# Copyright 2009-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
generate.py | #!/usr/bin/env python
import argparse
import os
import random
import sys
import time
from multiprocessing import Manager, Process
import string
import numpy as np
from captcha.image import ImageCaptcha
CLASSES = string.digits + string.lowercase
class PreProcessor(object):
@staticmethod
def L_split(length):
... |
email.py | from threading import Thread
from flask import render_template, current_app
from flask_mail import Mail, Message
from . import mail
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Message(app.config['FLASKY_MAIL_SUBJECT_PREFIX'] + subject,
sende... |
websockets.py | #!/usr/bin/python3
from aiohttp import web
import asyncio
import binascii
import json
import random
import socket
import sys
import threading
import zmq
import zmq.asyncio
from logger import logger
from rpcutils import rpcutils, errorhandler as rpcerrorhandler
from wsutils import wsutils, topics
from wsutils.broker imp... |
25-XPS.py | import numpy as np
from collections import ChainMap
from ophyd import DeviceStatus
from ophyd import EpicsSignal, EpicsMotor, EpicsSignalRO, Device, Component
from ophyd.utils.epics_pvs import data_type, data_shape
import epics
import bluesky.preprocessors as bpp
import bluesky.plan_stubs as bps
from collections impor... |
download.py | import glob
import logging
import os
import time
import traceback
from threading import Lock, Thread
from typing import List, Iterable, Dict
from bauh.api.abstract.download import FileDownloader
from bauh.api.abstract.handler import ProcessWatcher
from bauh.api.abstract.view import MessageType
from bauh.api.http impor... |
pdb.py | import numpy as np
import scipy.spatial as spatial
import time
import math
from math import log10, floor
from scipy import interpolate
import multiprocessing as mp
import os
import sys
import subprocess
def dihedral(lis):
"""formula from Wikipedia article on "Dihedral angle"; formula was removed
from the most ... |
pipe-vs-queue.py | """
Modified from:
https://stackoverflow.com/questions/48353601/multiprocessing-pipe-is-even-slower-than-multiprocessing-queue/48394435
"""
import sys
import time
from multiprocessing import Process, Pipe, Queue, SimpleQueue
import numpy as np
NUM = 20000
def worker_pipe(conn):
for task_nbr in range(NUM):
... |
lambda_executors.py | import os
import re
import sys
import glob
import json
import time
import logging
import threading
import traceback
import subprocess
import six
import base64
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
from pipes import quote as cmd_quote # for Pyth... |
cli.py | import os
import sys
import threading
from contextlib import contextmanager
import click
import six
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
from dagster import check, seven
from dagster.cli.workspace import Workspace, get_workspace_from_kwargs, workspace_target_argument
from dag... |
base_test.py | # -*- coding: utf-8 -*-
import copy
import datetime
import json
import threading
import elasticsearch
from unittest import mock
import pytest
from elasticsearch.exceptions import ConnectionError
from elasticsearch.exceptions import ElasticsearchException
from elastalert.enhancements import BaseEnhancement
from elasta... |
base_events.py | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... |
recalbox_SafeShutdown_gpi2.py | import RPi.GPIO as GPIO
import os
import time
from multiprocessing import Process
#initialize pins
powerPin = 26
powerenPin = 27
#initialize GPIO settings
def init():
GPIO.setmode(GPIO.BCM)
GPIO.setup(powerPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(powerenPin, GPIO.OUT)
GPIO.output(power... |
advanced-reboot.py | #
#ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";d... |
runner.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import io
import json
import os
import sys
import re
import time
import tempfile
import itertools
import datetime
import ... |
AVR_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python AVR Miner (v2.3.5)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import socket
import threading
import time
i... |
server.py | import json
from uuid import uuid4
import zmq
import threading
from subprocess import PIPE, run
from utils.colors import *
from utils.parser import ParserMessage
class Server:
def __init__(self):
"""
here we create public context
"""
self.context = zmq.Context()
@staticmetho... |
A3C_modified_rewards.py | """
PySC2_A3C_AtariNet.py
A script for training and running an A3C agent on the PySC2 environment, with reference to DeepMind's paper:
[1] Vinyals, Oriol, et al. "Starcraft II: A new challenge for reinforcement learning." arXiv preprint arXiv:1708.04782 (2017).
Advantage estimation uses generalized advantage estimation... |
server.py | import time
import json
import requests
from paho.mqtt import client as mqtt_client
broker = 'broker.hivemq.com'
port = 1883
topic1 = "vmk/team_6/r"
topic2 = "vmk/team_6/c"
# generate client ID with pub prefix randomly
client_id = f'python-mqtt-0'
worker_id = f'python-mqtt-1'
# username = 'emqx'
# password = 'public'... |
email.py | from flask_mail import Message
from threading import Thread
from flask import render_template, current_app
from flask_babel import lazy_gettext as _l
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_mail(subject, sender, recipients, text_body, html_body):
msg = Message(s... |
ElevatorGUI.py | # Refer to the following link for PyQt documentation:
# http://pyqt.sourceforge.net/Docs/PyQt4/classes.html
# Written for AMIS-30543 driver.
'''
At an RPM of 60 and an input of 200 steps in mode 1/1, takes motor 1 second to complete task
At an RPM of 120 and an input of 200 steps in mode 1/2, takes motor 1 second to c... |
sni.py | from pydivert import WinDivert
from threading import Thread
from requests import Session
from time import sleep
def DivertRST():
while True:
with WinDivert("tcp.SrcPort == 443 and tcp.PayloadLength == 0") as w:
try:
for packet in w:
packet.tcp.rst = False
... |
qira.py | import idaapi
import threading
import time
wsserver = None
qira_address = None
# this handles all receiving
msg_queue = [] # python array is threadsafe
def handle_message_queue():
global msg_queue
while len(msg_queue) > 0:
dat = msg_queue[0].split(" ")
msg_queue = msg_queue[1:]
if dat[0] == "setadd... |
snapraid-runner.py | #!/usr/bin/env python3
from __future__ import division
import argparse
import configparser
import logging
import logging.handlers
import os.path
import subprocess
import sys
import threading
import time
import traceback
from collections import Counter, defaultdict
from io import StringIO
# Global variables
config = N... |
train_faster_rcnn_alt_opt.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using... |
Lending.py | # coding=utf-8
from decimal import Decimal
import sched
import time
import threading
Config = None
api = None
log = None
Data = None
MaxToLend = None
Analysis = None
SATOSHI = Decimal(10) ** -8
sleep_time_active = 0
sleep_time_inactive = 0
sleep_time = 0
min_daily_rate = 0
max_daily_rate = 0
spread_lend = 0
gap_botto... |
HamsterHome.py | from firebase import Firebase
import serial
import io
from threading import Thread
import datetime
diameterOfWheel = 0.12
waterRef = Firebase('https://hamster-home.firebaseio.com/water')
foodRefillRef = Firebase('https://hamster-home.firebaseio.com/refillFood/refillFood')
foodRef = Firebase('https://hamster-home.fir... |
engine.py | #!/usr/bin/env python
""" Engine to start up subsystems."""
import os
import sys
import time
import django
from threading import Thread
sys.path.append('.')
os.environ['DJANGO_SETTINGS_MODULE'] = 'alfmonitor.settings'
django.setup()
from alfmonitor.lib.alflogger import logger
from agents.lib.subsystems import maile... |
test_app.py | import json
import random
import threading
import tornado.websocket
import tornado.gen
from tornado.testing import AsyncHTTPTestCase
from tornado.httpclient import HTTPError
from tornado.options import options
from tests.sshserver import run_ssh_server, banner
from tests.utils import encode_multipart_formdata, read_fi... |
twitter_api.py | # -*- coding: utf-8 -*-
import cPickle
import json
import sys
import threading
import time
import requests
import webbrowser
class Fetcher(object):
"""Abstracts the twitter API.
"""
def __init__(self):
"""Constructs the twitter fetcher.
"""
self.data = []
self.thread_loc... |
task_queue.py | from __future__ import absolute_import, division, unicode_literals
import logging
import Queue
import threading
import time
from flexget.task import TaskAbort
log = logging.getLogger('task_queue')
class TaskQueue(object):
"""
Task processing thread.
Only executes one task at a time, if more are request... |
HoloPortrait.py | import io
import os
import ui
import sys
import time
import Image
import numpy
import photos
import shutil
import socket
import console
import zipfile
import ImageOps
import objc_util
import matplotlib.cm
import urllib.request
from threading import Event, Thread
from socketserver import ThreadingMixIn
from http.server ... |
engine.py | """"""
import sys
import importlib
import traceback
from typing import Sequence, Any
from pathlib import Path
from datetime import datetime
from threading import Thread
from pandas import DataFrame
from vnpy.event import Event, EventEngine
from vnpy.trader.engine import BaseEngine, MainEngine
from vnpy.trader.consta... |
two-tasks.py | #!/usr/bin/env python
"""
Two progress bars that run in parallel.
"""
from __future__ import unicode_literals
from prompt_toolkit.shortcuts import ProgressBar
import time
import threading
def main():
with ProgressBar() as pb:
# Two parallal tasks.
def task_1():
for i in pb(range(100)):... |
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... |
test_singleton_multithread.py | import threading
from flying_ioc import IocManager
class TSingleton1:
def __init__(self):
pass
def _set_vars(ioc: IocManager, storage: dict):
def wrapped():
storage['singleton1'] = ioc.singleton1
storage['singleton2'] = ioc.singleton2
return wrapped
def test_multithread():
... |
etcd_rendezvous.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import datetime
import json
import logging
import random
import sys
import threading
impo... |
demo_1.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by Em on 2017/5/12
"""
多线程
"""
import time
import threading
# 新线程执行代码
def loop():
print 'thread %s is running...' % threading.current_thread().name
n = 0
while n < 5:
n = n + 1
print 'thread %s >>> %s' % (threading.current_thread().... |
uclex.py | #!/usr/bin/env python2
from scipy.stats import chisquare
import math
from Bio import Entrez
from phenotips_python_client import PhenotipsClient
from phenotips_python_client import browser
from bson.json_util import loads
from mongodb import *
# fizz: hpo lookup
import phizz
import itertools
import json
import os
impo... |
server.py | from multiprocessing import Process, Queue
input_queue = Queue()
output_queue = Queue()
f = open('plan_doc.txt','r')
paragraph_text = f.read()
def run_server(input_queue, output_queue):
import cherrypy
cherrypy.config.update({'server.socket_port': 8888,
# 'environment': 'production',
'engine.a... |
test_signal.py | import unittest
from test import support
from contextlib import closing
import gc
import pickle
import select
import signal
import struct
import subprocess
import traceback
import sys, os, time, errno
from test.script_helper import assert_python_ok, spawn_python
try:
import threading
except ImportError:
threadi... |
c-realV2.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 - 2021
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
t... |
mission_test.py | #!/usr/bin/env python2
#***************************************************************************
#
# Copyright (c) 2015-2016 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... |
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... |
performer.py | # Created By: Virgil Dupras
# Created On: 2010-11-19
# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/g... |
chisel.py | """
A simple client that uses the Python ACME library to run a test issuance against
a local Boulder server. Usage:
$ virtualenv venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ python chisel.py foo.com bar.com
"""
import json
import logging
import os
import sys
import threading
import time
import urllib... |
installinstallmacos_gui.py | #!/System/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python
# -*- coding: utf-8 -*-
#
# Copyright 2019 Glynn Lane (primalcurve)
#
# Based on installinstallmacos.py
# Copyright 2017 Greg Neagle.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... |
HiwinRA605_socket_ros_20190604111639.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
lambda_multiproc.py | import math
import logging
from multiprocessing import Process, Pipe
# all functions that lambda_multiproc must create this logger
logger = logging.getLogger('main_logger')
def multiproc_requests(rows, proc_count, func):
logger.debug('Spawning {} processes'.format(proc_count))
per_proc = int(math.ceil(len(r... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_zcash
from electrum_zcash.bitcoin import TYPE_ADDRESS
from electrum_zcash import WalletStorage, Wallet
from electrum_zcash_gui.kivy.i18n import _
from electrum_zcash.paymentrequest i... |
relation_engine_bulk_updateServer.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... |
duco.py | import serial
import re
import json
import sys
import logging
import paho.mqtt.client as mqtt
from datetime import datetime
from time import sleep
from threading import Thread
from utils import pathify, changes
# TODO: clean this up
from commands import *
# Set up logging
logging.basicConfig(level=logging.INFO)
log =... |
functions.py | from stravalib import Client, exc
from gpxpy import geo as mod_geo
import multiprocessing as mp
from datetime import datetime
import xml.etree.ElementTree as ET
import os
def gettoken():
token=None
with open(os.path.expanduser('~/.smoothify'), 'r') as f:
c = f.readlines()
for line in c :
wo... |
client.py | # Copyright (c) 2012-2014 Roger Light <roger@atchoo.org>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
... |
sync.py | from util import *
from threading import Thread
class Mutex(Waitable):
def __init__(self, ctu, ptr):
self.setup()
self.ctu = ctu
self.ptr = ptr
self.waitable_presignalable = False
@property
def value(self):
return self.ctu.read32(self.ptr)
@property
def owner(self):
handle = self.va... |
FtpServer.py |
import socket
import json
import logging
import os
import base64
from concurrent.futures import ThreadPoolExecutor
from time import sleep
from FtpMessage import FtpMessage
from FtpMessage import FtpData
from FtpMessage import FtpMessageEncoder
from FtpMessage import FtpResult
class FtpServer:
MAX_BYTES = 65536... |
vpp_transport_socket.py | #
# VPP Unix Domain Socket Transport.
#
import socket
import struct
import threading
import select
import multiprocessing
import logging
class VppTransport:
def __init__(self, parent, read_timeout, server_address):
self.connected = False
self.read_timeout = read_timeout if read_timeout > 0 else 1
... |
FDU_JWC.py | import requests, traceback, threading
from lxml import etree
try:
from public.summary import getSummary
except:
import os, sys
sys.path.append("..")
sys.path.extend([os.path.join(root, name) for root, dirs, _ in os.walk("../") for name in dirs])
from summary import getSummary
from sqlite3 import In... |
actions.py | import pydirectinput as pag
from time import sleep, time
import pydirectinput
import time
from threading import Thread, Lock
class Actions():
def __init__(self, test_mode=False) -> None:
self.pressed_keys = []
self.test_mode = test_mode
def move_direction(self, relx, rely):
# Handling... |
rdd.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
test_sampling.py | from functools import partial
import math
import threading
import pickle
import pytest
from copy import deepcopy
import numpy as np
from numpy.testing import assert_allclose, assert_equal, suppress_warnings
from numpy.lib import NumpyVersion
from scipy.stats import (
TransformedDensityRejection,
DiscreteAliasUr... |
bus.py | import paho.mqtt.client as mqtt
import threading
class Config:
def __init__(self):
self.username = None
self.password = None
self.host = None
self.port = 1883
self.site = "default"
def create_client(self, name):
res = mqtt.Client(name)
if self.username is not None:
res.username_pw_set(self.username... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.