source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
forking.py | # -*- coding: utf-8 -*-
'''
Test basic uxd stacking and yarding with multiprocesses
'''
import multiprocessing
import time
from salt.transport.road.raet import stacking
from salt.transport.road.raet import yarding
ESTATE = 'minion1'
def fudal():
'''
Make a single process raet uxd stack
'''
lord_stac... |
scheduler.py | # SPDX-FileCopyrightText: 2020 Splunk Inc.
#
# SPDX-License-Identifier: Apache-2.0
from future import standard_library
standard_library.install_aliases()
from builtins import object
import threading
from time import time
import random
import queue
from splunktalib.common import log
class Scheduler(object):
"""
... |
tdx.py | #coding:utf-8
"""
tradex 行情和交易适配
"""
"""
量化技术指标计算
https://github.com/QUANTAXIS/QUANTAXIS/blob/master/QUANTAXIS/QAData/base_datastruct.py
"""
import copy
import time,datetime
import traceback
import threading
from collections import OrderedDict
from functools import partial
from dateutil.parser import parse
from ... |
eventstream.py | ##
# Copyright 2016 Jeffrey D. Walter
#
# 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 w... |
bot.py | import logging
import time
import sys
import numpy as np
import re
import time
import keyboard
from multiprocessing import Value, Process
from queue import Queue
from bson.objectid import ObjectId
from datetime import datetime
from .trader import Trader
from .tree_navigator import TreeNavigator
from .utils import get... |
controller.py | import re
import time
import traceback
from threading import Thread
from typing import List, Set, Type, Optional, Tuple
from bauh.api.abstract.controller import SoftwareManager, SearchResult, ApplicationContext, UpgradeRequirements, \
TransactionResult, SoftwareAction
from bauh.api.abstract.disk import DiskCacheLo... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development 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 ... |
server.py | import socket, cv2, pickle, struct
import imutils
import threading
import pyshine as ps
import cv2
server_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
print('HOST IP:',host_ip)
port = 9999
socket_address = (host_ip,port)
server_s... |
manager.py | from dataclasses import dataclass
import logging
import threading
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element
from chiapos import DiskProver
from chia.conse... |
cli.py | from __future__ import absolute_import
import contextlib
import os
import subprocess
import tempfile
import threading
import time
from typing import Callable, Iterator, Optional
import click
import jinja2
import shamiko
from shamiko import proc_utils, session_utils
from shamiko.gdb_rpc import (
FrameWrapper,
... |
el_cruce_rio.py | from threading import Semaphore,Thread
from time import sleep
import random
hackers=0
serfs=0
lista_hackeres=Semaphore(0)
lista_serfs=Semaphore(0)
total=4
mutex_balsa=Semaphore(1)
def hacker(num):
global hackers,serfs,esCap
#print("hacker %d esperando ..." %num)
mutex_balsa.acquire()
hackers+=1
print("hacker ... |
3.event.py |
'''
说明: 用于线程通讯, 一个线程完成之后,通知其他的线程
'''
from threading import Event, Thread
def work(event: Event):
print('员工:工作完成')
event.set()
def boss(event: Event):
print('老板:分配工作')
w = Thread(target=work, args=(event,))
w.start()
event.wait()
print('老板:good job')
def main():
event = Event()
... |
main.py | """
Run this file to open the bot.
Change the contents of if __name__ == '__main__'
to change bot behaviour for testing purposes. For example,
you may call test_beeps_and_browser() to see how loud the notification is.
Change the contents of properties.yml to
change the runtime behaviour of the bot.
This script is lic... |
nrf24_manager.py | #! venv/bin/python
import yaml
import paho.mqtt.client as mqtt
import logging
import sys
import time
import threading
from RF24 import RF24, RF24_PA_LOW, RF24_250KBPS, RF24_CRC_8
import RPi.GPIO as GPIO
class Nrf24Manager:
def __init__(self, radio_config_file: str, mqtt_config_file: str):
# load config
... |
vm_util.py | # Copyright 2014 PerfKitBenchmarker 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... |
test_apiserver.py | # -*- coding: utf-8 -*-
"""
tests.apiserver
~~~~~~~~~~~~
Tests cobra.api
:author: 40huo <git@40huo.cn>
:homepage: https://github.com/wufeifei/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
"""
import json
import multiproc... |
domain_detail.py | from threading import Thread
from flask import render_template, request, redirect, url_for, flash
from flask_login import login_required, current_user
from app.config import EMAIL_SERVERS_WITH_PRIORITY, EMAIL_DOMAIN
from app.dashboard.base import dashboard_bp
from app.dns_utils import (
get_mx_domains,
get_sp... |
periodic.py | # Copyright 2019 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... |
wrappers.py | import atexit
import functools
import sys
import threading
import traceback
import gym
import numpy as np
from PIL import Image
import cv2
import pybullet
import pybullet_envs
class DeepMindControl:
def __init__(self, name, size=(64, 64), camera=None):
domain, task = name.split('_', 1)
if domain... |
benchmarkingv2.py | from datastructures import structures
import random, time, gc, threading
import traceback
import pathlib, sys
import platform
import numpy as np
MININT = -2147483648
MAXINT = 2147483647
def init_structure(name, preload = []):
kls = "datastructures.{0}.{0}".format(name)
parts = kls.split('.')
... |
train_pg.py | import inspect
import math
import os
import time
from multiprocessing import Process
from typing import List
import gym
import numpy as np
import scipy.signal
import tensorflow as tf
import logz
# ============================================================================================#
# Utilities
# ============... |
main.py | #!/usr/bin/python3
# coding=utf-8
import pymysql
import pydle
import random
from random import choice
import datetime
import time
from threading import Timer, Thread
import urllib.request
import requests
import json
import threading
import math
import functools
from string import ascii_letters
from collections import d... |
game_controller.py | import os
import threading
import time
import cv2
from template_finder import TemplateFinder
from utils.auto_settings import check_settings
from bot import Bot
from config import Config
from death_manager import DeathManager
from game_recovery import GameRecovery
from game_stats import GameStats
from health_manager i... |
simulation_3.py | '''
Created on Oct 12, 2016
@author: mwittie
'''
# modified by Keely Wiesbeck and Alex Harry
import network_3
import link_3
import threading
from time import sleep
##configuration parameters
router_queue_size = 0 # 0 means unlimited
simulation_time = 10 # give the network sufficient time to transfer all packets be... |
parser.py | import os
import re
import urllib
from threading import Thread
from urllib import parse
from myqueue.Context import Context
from myqueue.contentqueue import ContentQueue
from myqueue.savequeue import SaveQueue
from concurrent.futures import ThreadPoolExecutor
from myqueue.urlqueue import UrlQueue
import copy
class p... |
__init__.py | # -*- coding: utf-8 -*-
"""
The top level interface used to translate configuration data back to the
correct cloud modules
"""
# Import python libs
from __future__ import absolute_import, generators, print_function, unicode_literals
import copy
import glob
import logging
import multiprocessing
import os
import signal... |
capture_manager.py | """Capture manager for sniffer device."""
from bisect import bisect
import json
import os
import time
from threading import Thread
# Some default values, specific to Ellisys BXE400 in 2011 lab.
# TODO(liuta): create config log for these parameters.
DEFAULT_CAP_DIR = r'C:\Users\tao\bxe400_traces' # Also a FTP base ... |
MyTheradClass_lock2.py | import threading
import time
konci2 = threading.Lock()
#lock = digunakan untuk block sebuah thread untuk melakukan execute sebelum thread lain beres
#lock2 = posisi dari method release() yang diubah akan mempengaruhi output
def orang_pertama(konci2):
konci2.acquire()
print('orang - 1 sedang menggunakan kamar ... |
logsclient.py | """This file implements a threaded stream controller to return logs back from
the ray clientserver.
"""
import sys
import logging
import queue
import threading
import grpc
import ray.core.generated.ray_client_pb2 as ray_client_pb2
import ray.core.generated.ray_client_pb2_grpc as ray_client_pb2_grpc
logger = logging.g... |
circDemo.py | #!/usr/bin/env python
#Drone 1: Forward/backward; (0,-0.6,0.4) <-> (0,0.6,0.4)
#Drone 2: Circle, center(0,0,0.4) radius(0.6).
#Drone 2 stops + hovers when Drone 1 is near endpoints, (within 0.2?)
#D2: PLACE AT x=+r. THEN GOES TO y=+r
#D1: PLACE AT y=-r, THEN GOES TO y=+r
import rospy
import tf
from crazyflie... |
handlers.py | # Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
train_10step.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
import sys
import time
import math
import os
import random
import argparse
import numpy as np
torch.manual_seed(0)
class Da... |
settings_20210906111200.py | """
Django settings for First_Wish project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathli... |
plot_from_pp_geop_height_tcwv_and_wind_mean_state_diff.py | """
Load pp, plot and save
8km difference
"""
import os, sys
#%matplotlib inline
#%pylab inline
import matplotlib
#matplotlib.use('Agg')
# Must be before importing matplotlib.pyplot or pylab!
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rcParams
from mpl_t... |
server.py | import socket
import threading
import pickle
import os
import sys
groups = {}
fileTransferCondition = threading.Condition()
class Group:
def __init__(self,admin,client):
self.admin = admin
self.clients = {}
self.offlineMessages = {}
self.allMembers = set()
self.onlineMembers = set()
self.joinRequests = s... |
sockServer.py | import asyncio
import websockets
import json
import threading
from protocol import field, action, motor, power
class sockServer:
'''Starts websocket server, listens for connections, and facilitates automatic reading and writeng from connetions
Args:
receiveEvent (function(str)): called when message is ... |
bootstrap.py | """
Bootstrap an installation of TLJH.
Sets up just enough TLJH environments to invoke tljh.installer.
This script is run as:
curl <script-url> | sudo python3 -
Constraints:
- Entire script should be compatible with Python 3.6 (We run on Ubuntu 18.04+)
- Script should parse in Python 3.4 (since we exit with... |
arm.py | """Arm part module.
Implements a Right and a Left Arm.
"""
import time
import numpy as np
from operator import attrgetter
from collections import OrderedDict
from threading import Thread, Event
from .hand import LeftEmptyHand, RightEmptyHand, LeftForceGripper, RightForceGripper, OrbitaWrist
from .part import Reachy... |
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):
# ------------------------------------------------------------------------... |
crlf_injection_v1.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import mechanize
import requests
import random
import sys
from urlparse import urlparse
from urlparse import parse_qs
from urlparse import urlunsplit
import timeit
import argparse
import os
import multiprocessing as mp
import time
from pymongo import MongoClient
connection =... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
test_misc.py | import os
from hashlib import md5
from twisted.internet import defer, reactor
from twisted.trial import unittest
from lbrynet import conf
from lbrynet.core.server.BlobAvailabilityHandler import BlobAvailabilityHandlerFactory
from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier
from lbrynet.core.StreamDe... |
player.py | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Awayume
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 r... |
mqtt_ws_example_test.py | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
import re
import os
import sys
import paho.mqtt.client as mqtt
from threading import Thread, Event
try:
import IDF
from IDF.IDFDUT import ESP32DUT
except Exception:
# this is a test case write with tiny-... |
get_frame.py | from concurrent.futures import wait
import rclpy
from rclpy.node import Node
from rclpy.executors import SingleThreadedExecutor
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Image
from Ui_untitled import Ui_MainWindow
from PyQt5 import QtWidgets,QtCore
from PyQt5.QtWidgets import *
from PyQ... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
repl.py | import inspect
import itertools
import socket
import threading
from src.config import bc
from src.log import log
REPL_HOST = ''
class REPLCommands:
@staticmethod
def help(message):
commands = [func[0] for func in inspect.getmembers(REPLCommands, inspect.isfunction)
if not func[0]... |
downloadclient.py | # Copyright 2018 CERN for the benefit of the ATLAS collaboration.
#
# 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 appl... |
xbrl_run.py | # -*- coding: utf-8 -*-
import os
import time
from pathlib import Path
import multiprocessing
import json
import codecs
import pickle
from multiprocessing import Process, Array
from xbrl_reader import Inf, SchemaElement, Calc, init_xbrl_reader, read_company_dic, readXbrlThread, make_public_docs_list
start_time = time.... |
main.py | import win32api
import win32gui
import win32ui
import win32con
from PIL import ImageGrab
import PIL
import matplotlib.pyplot as plt
import numpy as np
import time
import torch
import torch.backends.cudnn as cudnn
from digitTrain import MyModel
from digitTrain import MyDataSet
import sys
from multiprocessi... |
test_dispatcher.py | import numpy as np
import threading
from numba import cuda, float32, float64, int32, int64, void
from numba.core.errors import NumbaDeprecationWarning
from numba.cuda.testing import skip_on_cudasim, unittest, CUDATestCase
import math
def add(x, y):
return x + y
def add_kernel(r, x, y):
r[0] = x + y
@skip... |
face_detection.py | # MIT License
#
# Copyright (c) 2019 Jian James Astrero
#
# 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... |
train_node.py | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... |
trezor.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, versiontuple, UserCancelled
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub,
TYPE_ADDRESS, TYPE_SCRIPT, is_address)
from electrum import consta... |
worker.py | # Copyright (c) 2020-2021, NVIDIA CORPORATION & AFFILIATES. 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 ... |
test_model.py | # encoding: utf8
from __future__ import unicode_literals
import tempfile
import os
import pytest
import threading
import time
from ...neural._classes import model as base
from ...neural.ops import NumpyOps
@pytest.fixture
def model_with_no_args():
model = base.Model()
return model
def test_Model_defaults_... |
eventnode.py | #!/usr/bin/python3
# coding=utf-8
# Copyright 2021 getcarrier.io
#
# 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 req... |
1_basic.py | """
Terminologies:
- CPU - Piece of hardware that executes code
- OS - Handles the scheduling of when the CPU can be used
- PROCESS - A program that is been executed
- THREAD - A part of the program that is using the CPU, some programs are very
very simple and they only do one thing so they reall... |
sdb.py | from __future__ import print_function
import cmd
import contextlib
import errno
import logging
import os
import pprint
import re
import rlcompleter
import select
import signal
import socket
import sys
import termios
import threading
import tty
from multiprocessing import process
from pdb import Pdb
import six
from six... |
predictor_utilities.py | import os
import numpy as np
import math
import re
import time
from multiprocessing import Queue
import multiprocessing
######################################
##common utitiltes
######################################
def closestMultiple(n, x):
if x > n:
return x;
z = (int)(x / 2);
n = n + z;... |
set-squelch.py | #!/bin/python
"""Sets the squelch level."""
import subprocess
import threading
import time
import io
def bytes_at_squelch_level(squelch_level):
"""Returns the number of bytes received at a squelch level."""
# Python 3
if hasattr(subprocess, 'DEVNULL'):
devnull = subprocess.DEVNULL
else:
... |
handler.py | import logging
import time
from abc import ABCMeta
from collections import defaultdict
from Queue import Queue
from threading import Lock, Thread
from __main__ import config
from ..types import ActiveHunter, Hunter
from ...core.events.types import HuntFinished
import threading
global queue_lock
queue_lock = Lock()
... |
update_number_of_words.py | # -*- encoding: utf-8 -*-
from queue import Queue, Empty
from threading import Thread
from django.core.management.base import BaseCommand
from ...models import TransTask
from ...utils import get_num_words
class Command(BaseCommand):
help = "Update the number of words to translate in every task"
queue = Que... |
buttontest(v1).py | from gpiozero import Button
from time import sleep
import tkinter as tk
from threading import Thread
button17 = Button("GPIO17")
button22 = Button("GPIO22")
button23 = Button("GPIO23")
button27 = Button("GPIO27")
class buttonpush():
def __init__(self):
#Thread.__init__(self)
self.b = False
... |
utils.py | import threading
from playhouse.shortcuts import model_to_dict
from bilibili_api import Bilibili
from model import Video, PlayList
def models_to_dict(models):
return [model_to_dict(orm) for orm in models]
def thead(video_id):
client = Bilibili()
client.download_by_id(video_id)
Video.update(is_comp... |
mouse.py | from threading import Thread
from time import time, sleep
# Создаем контроллер мыши
from pynput.mouse import Controller
from . import BaseModule
mouse = Controller()
class MouseModule(BaseModule):
move_events = list()
def __init__(self):
super().__init__(name='mouse', source=100)
# Создае... |
core.py | """
Simple package for receiving and sending data over serial. Data is framed in packets:
|START|LEN|ID|... PAYLOAD BYTES ...|CRC|END|
Each packet has:
id: 0-255 identifier byte
payload: any data bytes
Packets are received and sent using two threads handling the serial port.
Callback targeting specific packet i... |
autorunner.py | import random
from multiprocessing import Process
from parser import drawState, from_python
from states import State, JoinResult
from orbiter import OrbiterStrategy
from swarmer import SwarmerStrategy
from interaction import send2
from orbit_util import sign, trace_orbit
_, [p1, p2] = send2([1, 0])
def survivor_stra... |
engine.py | """"""
import sys
from threading import Thread
from queue import Queue, Empty
from copy import copy
from vnpy.event import Event, EventEngine
from vnpy.trader.engine import BaseEngine, MainEngine
from vnpy.trader.constant import Exchange
from vnpy.trader.object import (
SubscribeRequest,
TickData,
BarData... |
when_switch.py | '''
listens for pool switch command
'''
import datetime
from threading import Thread
from queue import Queue
from colorama import Fore
#from pika.exceptions import ChannelClosed
from helpers import antminerhelper
from helpers.queuehelper import QueueName
from domain.mining import MinerCommand, MinerAccessLevel
from dom... |
server.py | #!/usr/bin/env python
# Flirble DNS Server
# Main server
#
# Copyright 2016 Chris Luke
#
# 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/LICENS... |
event_source.py | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... |
ucprocess.py | # Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Ralph ... |
game.py | import MalmoPython
import os
import random
import threading
import time
import malmoutils
import pyson.runtime
from jason_malmo.actions import actions
from jason_malmo.agent import Agent
from jason_malmo.exceptions import NoAgentsException
from jason_malmo.tasks import TaskManager
class Game:
"""Game main class... |
123.py | import threading
import os
from random import random
from pathlib import Path
def threadingz():
while True:
tempz = open("temp.txt","w+")
fuel = open("fuel.txt","w+")
speed = open("speed.txt","w+")
tempz.write("13")
fuel.write("152")
speed.write("200")
print(f"write done ")
t... |
unix.py | #!/usr/bin/env python3
"""Module for BSD-specific features, which are not available on other operating
systems."""
__author__ = 'Philipp Engel'
__copyright__ = 'Copyright (c) 2019, Hochschule Neubrandenburg'
__license__ = 'BSD-2-Clause'
import queue
import shlex
import subprocess
import time
import threading
from e... |
test_forward_backward.py | from sys import version
from bittensor._endpoint import endpoint
import bittensor
import torch
import pytest
from unittest.mock import MagicMock
from torch.autograd import Variable
import multiprocessing
import time
dendrite = bittensor.dendrite()
dendrite.receptor_pool.forward = MagicMock(return_value = [torch.tensor... |
procmonManager.py | ################################################################################
# procmon, Copyright (c) 2014, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
#
# If you ha... |
pvDisplayPi0SimpleGUI.py | # pv display for Pi0 using python3 and PySimpleGUI
import time
from time import ctime
from datetime import datetime
import pytz
import json
import paho.mqtt.client as mqtt
import threading
Vin = ' 00.0'
Vout = ' 00.0'
Iin = ' 00.00'
Iout = ' 00.00'
ptz = pytz.timezone('America/Los_Angeles')
utc = pytz.timezone('UTC')
... |
fileobserver.py | import os
import glob
import time
import threading
import berrymq
class FileObserver(object):
def __init__(self, target_dir, id_name, interval=5):
self.id_name = id_name
self.target_dir = target_dir
self.interval = interval
self.fileinfo = self._get_fileinfo()
self.thread = ... |
bitmex_websocket.py | # coding: UTF-8
import hashlib
import hmac
import json
import os
import threading
import time
import traceback
import urllib
import websocket
from datetime import datetime, timedelta
from src import logger, to_data_frame, notify
from src.config import config as conf
def generate_nonce():
return int(round(time.t... |
botserver.py | # coding: utf-8
from __future__ import absolute_import, with_statement, print_function, unicode_literals
__version__ = '20.272.2127' # gzip_decode
#__version__ = '20.260.0040' # binary
#__version__ = '20.219.1837'
#__version__ = '20.211.1402'
#__version__ = '20.196.1406'
#__version__ = '20.104.0843'
#__version__ = '... |
toil_wes.py | import json
import os
import subprocess
import time
import logging
import uuid
import shutil
from multiprocessing import Process
from wes_service.util import WESBackend
logging.basicConfig(level=logging.INFO)
class ToilWorkflow:
def __init__(self, run_id):
"""
Represents a toil workflow.
... |
alpaca_paper.py | '''Reference: https://github.com/alpacahq/alpaca-trade-api-python/tree/master/examples'''
import datetime
import threading
from neo_finrl.alpaca.alpaca_engineer import AlpacaEngineer
import alpaca_trade_api as tradeapi
import time
import pandas as pd
import numpy as np
import torch
'''please input your ow... |
custom_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... |
test_gc.py | # expected: fail
import unittest
from test.test_support import verbose, run_unittest
import sys
import time
import gc
import weakref
try:
import threading
except ImportError:
threading = None
### Support code
###############################################################################
# Bug 1055820 has se... |
tasksconsumer.py | from uwsgidecorators import *
import Queue
from threading import Thread
queues = {}
class queueconsumer(object):
def __init__(self, name, num=1, **kwargs):
self.name = name
self.num = num
self.queue = Queue.Queue()
self.threads = []
self.func = None
queues[self.name] = self
@staticmetho... |
core.py | import os
import threading
import yaml
from flask import Flask
from flask_debugtoolbar import DebugToolbarExtension
from flask_login import LoginManager
from flask_cors import CORS
from jinja2 import FileSystemLoader
from lxml import etree
from portality import settings, constants
from portality.bll import exceptions... |
deal.py | # pylint: disable=missing-docstring, no-name-in-module, invalid-name
from os import getcwd, chdir
from threading import Thread
from behave import given, when, then
from nose.tools import assert_true, assert_equal, assert_is_none, assert_is_not_none
from nose.tools import assert_in, assert_not_in, assert_greater
from b... |
show_result.py | #!/usr/bin/env python
# coding: utf-8
""""
Usage: python show_data.py
"""
# In[1]:
import os
import numpy as np
from scipy import spatial
import glob
from multiprocessing import Process
from tqdm import tqdm
from vedo import load, show, Point
import math
import sys
# ## 一、自定义函数
# ### 1.获取模型信息
# In[2]:
def get... |
manager.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... |
simulate-alert.py | import sys
import requests
import threading
######################################################################################
# Run the load-tests on the endpoint #
######################################################################################
def load_test(... |
speech_synthesizer_demo.py | # -*- coding: utf-8 -*-
"""
* Copyright 2015 Alibaba Group Holding Limited
*
* 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
*
* Unl... |
HowTo-UsingRealTimeGeoDistributedDatabase.py | from c8 import C8Client
import random
import threading
import time
# Variables
service_url = "gdn1.macrometa.io" # The request will be automatically routed to closest location.
user_mail = "user@example.com"
user_password = "hidden"
geo_fabric = "testfabric"
collection_name = "employees" + str(random.randint(1, 10000)... |
GoodEyes.py | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 26 12:14:08 2022
@author: nuria
#todo
- change so that it does not pop up two times if I am already away (maybe sleep for 1sec? lets try)
"""
from __future__ import print_function
from threading import Thread
import pygame
import datetime
import time
... |
conditional_accumulator_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... |
server.py | # -*- coding: utf-8 -*-
import socket
from threading import Thread
from zlib import compress
import binascii
from mss import mss
from PIL import Image
import numpy as np
#import grab_screen
import numpy
import sys
#import pygame
import win32gui, win32ui, win32con, win32api
import cv2
import time
import php
import ctype... |
output_processor.py |
# Copyright Jamie Allsop 2011-2019
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#-------------------------------------------------------------------------------
# Output Processor
#------... |
conftest.py | # coding: utf-8
"""
"""
import getpass
import copy
import logging
import os
import random
import threading
import time
import cherrypy
import flask
import flask_login
import pytest
import requests
import sqlalchemy
import sampledb
import sampledb.utils
import sampledb.config
sampledb.config.MAIL_SUPPRESS_SEND = Tr... |
server.py | #!/usr/bin/env python3
#
# https://docs.python.org/3.5/library/socket.html
#
import socket
import threading
import time
# --- constants ---
HOST = '' # local address IP (not external address IP)
# '0.0.0.0' or '' - conection on all NICs (Network Interface Card),
# '127.0.0.1' or 'localh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.