source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
aioserver.py | from aiohttp import web
import aiohttp
import paramiko
import threading
import aiohttp_cors
import asyncio
async def rev_send(socket):
while not socket.ws.closed:
asyncio.sleep(0.1)
try:
data = socket.shell.recv(8192)
await socket.ws.send_bytes(data)
except Exceptio... |
run.py | #!/usr/bin/python
# Standard Library
import os
import sys
import time
import subprocess
from threading import Thread
from Queue import Queue
# Third Party
import yaml
# Local
waitTime = 10
services = [
{
"name": "frontend",
"command": ["./main.py", "-e", "-d"],
"color": "1"
},
... |
test.py | import argparse
import json
import os
from pathlib import Path
from threading import Thread
import numpy as np
import torch
import yaml
from tqdm import tqdm
from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import coco80_to_coco91_class, check_dataset, check... |
control.py | import pickle
import paho.mqtt.client as mqtt
from threading import Thread
import time
import os
# algorithm imports
mec_nodes = {}
class BrokerCom:
def __init__(self, user, pw, ip, sub_topic):
self.user = user
self.pw = pw
self.ip = ip
self.port = 1883
self.topic = sub_to... |
abs_task.py | from abc import ABC
from abc import abstractmethod
import argparse
from distutils.version import LooseVersion
import functools
import logging
import os
from pathlib import Path
import sys
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from ... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
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 struct
import operator
import weakref
import test.support
import test.... |
guassian.py | # Postprocessed pair results by calculating mean/std. deviation, and finding approrpaite outliers.
# assignment args:
# - see processor/edit_distance.py
# - alternatively, just use a files list
# postprocessor args:
# - sourceSuffix (string) - Suffix used by the processor.
# - resultsSuffix (string) - Suffix used by th... |
main.py | import resource
import socket
import sys
import time
from contextlib import suppress
from multiprocessing.managers import MakeProxyType
import _pytest.fixtures
from multiprocessing import JoinableQueue, Process, Queue
from multiprocessing.managers import SyncManager, RemoteError
from typing import List, Any, Optional,... |
logging_test.py | # Copyright 2017 The Abseil 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 ... |
pc_keyboard-check.py | #!/usr/bin/python3.7
#encoding:utf-8
import pynput
import threading
from socket import *
import threading
address="192.168.31.106" #8266的服务器的ip地址
port=8266 #8266的服务器的端口号
buffsize=1024 #接收数据的缓存大小
s=socket(AF_INET, SOCK_STREAM)
s.connect((address,port))
def fun():
while True:
... |
http_server.py | #!/usr/bin/env python
# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
# Many tests expect there to be an http server on port 4545 servering the deno
# root directory.
from collections import namedtuple
from contextlib import contextmanager
import os
import SimpleHTTPServer
import SocketServer
... |
restore_wechat_backup.py | #!/usr/bin/python -u
"""
Copyright 2017, Jacksgong(https://blog.dreamtobe.cn)
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 applicab... |
slcan.py | #
# Copyright (C) 2014-2016 UAVCAN Development Team <uavcan.org>
#
# This software is distributed under the terms of the MIT License.
#
# Author: Ben Dyer <ben_dyer@mac.com>
# Pavel Kirienko <pavel.kirienko@zubax.com>
#
from __future__ import division, absolute_import, print_function, unicode_literals
import... |
qgmnode.py |
from bitarray import bitarray
from random import *
from time import sleep
from threading import Thread
import sys
from cqc.pythonLib import *
from protocol import *
from utils import *
##############################
#
# QGMNode class derived from CQCConnection, with reg* attributes
#
class QGMNode():
def __init... |
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... |
default_launch_description.py | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
event-capture.py | import paho.mqtt.client as mqtt
import urllib.request as request
import logging
import logging.config
import json
import os
import shutil
import datetime
import urllib
from queue import Queue
from threading import Thread
from subprocess import call
IMAGE_URL = "http://192.168.37.21/oneshotimage.jpg"
# The MQTT host wi... |
test_target_codegen_vulkan.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
run.py | #! /usr/bin/env python3
#
# Copyright (C) 2017-2021 Open Information Security Foundation
#
# 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 ... |
automl.py | #Damir Jajetic, 2015
from sklearn.externals import joblib
from sklearn import *
from sklearn.utils import shuffle
import libscores
import multiprocessing
import time
import os
import numpy as np
import data_io
import psutil
import data_converter
import automl_worker
import automl_models
import automl_blender
import au... |
buildserver.py | #!/usr/bin/python3
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import argparse
import ctypes
import functools
import sys
import threading
import traceback
import os.path
class BuildHTTPServer(ThreadingMixIn, HTTPServer):
allow_reuse_address = True
advapi32... |
test_sys.py | import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.support imp... |
Crawler.py | import FileSystem, re
from threading import Thread
from urllib.parse import quote
from Webpage import Webpage
from colorama import Fore, Style
class Crawler(object):
def __init__(self, urls):
self.urls = urls
self.found_urls = []
self.threads = []
def error(err, err_code):
... |
test__threading_vs_settrace.py | from __future__ import print_function
import sys
import subprocess
import unittest
import gevent.thread
script = """
from gevent import monkey
monkey.patch_all()
import sys, os, threading, time
# A deadlock-killer, to prevent the
# testsuite to hang forever
def killer():
time.sleep(0.1)
sys.stdout.write('..p... |
__init__.py | __author__ = "Johannes Köster"
__copyright__ = "Copyright 2022, Johannes Köster"
__email__ = "johannes.koester@uni-due.de"
__license__ = "MIT"
from abc import abstractmethod
import os
import sys
import contextlib
import time
import datetime
import json
import textwrap
import stat
import shutil
import shlex
import thre... |
dataset_generator.py | from __future__ import division, absolute_import, print_function
import argparse
import glob
import multiprocessing
import os
import shutil
import time
import numpy as np
from stable_baselines import PPO2
from stable_baselines.common.vec_env import DummyVecEnv, VecNormalize
from stable_baselines.common.policies impor... |
detector_utils.py | # Utilities for object detector.
import numpy as np
import sys
import tensorflow as tf
import os
from threading import Thread
from datetime import datetime
import cv2
import label_map_util
from collections import defaultdict
detection_graph = tf.Graph()
sys.path.append("..")
# score threshold for showing bounding ... |
flasher.py | """Flashing windows."""
import logging
from threading import Thread
from time import sleep
from typing import Dict, List
from flashfocus.compat import Window
from flashfocus.types import Number
class Flasher:
"""Creates smooth window flash animations.
If a flash is requested on an already flashing window, t... |
client.py | import socket
from tkinter import *
from threading import Thread
import random
from PIL import ImageTk, Image
screen_width = None
screen_height = None
SERVER = None
PORT = None
IP_ADDRESS = None
playerName = None
canvas1 = None
canvas2 = None
nameEntry = None
nameWindow = None
gameWindow = None
leftBoxes = []
rig... |
player.py |
# content: 简单玩家类的设计与实现。使用多线程进行后台人机下棋模拟
import abc
from mcts.search import *
from mcts.node import TwoPlayerGameMonteCarloTreeSearchNode
from four_in_row.FourInRow import *
from threading import Thread
import time
class Player(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def choose_next_move(... |
local_job_service.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... |
utils.py | import os
import re
import numpy as np
import pandas as pd
from typing import Tuple, List, Union, Optional, Iterable
from collections import defaultdict, OrderedDict
from PIL import Image
from tqdm import tqdm
from functools import reduce
import operator
import multiprocessing
import json
from itertools import produ... |
__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 ... |
__init__.py | #! /usr/bin/env python
'''Our base worker'''
from __future__ import print_function
import os
import code
import signal
import shutil
import sys
import traceback
import threading
from contextlib import contextmanager
from six import string_types
from six.moves import zip_longest
# Internal imports
from qless.listen... |
tv_serial.py | import time, serial, threading
class TvSerial:
@staticmethod
def handler(signum, frame):
raise Exception("Serial connection timeout")
@staticmethod
def writeCommandAsync(command):
thread = threading.Thread(target=TvSerial.writeCommand, args=(command,))
thread.daemon = True ... |
test_logging.py | # Copyright 2001-2022 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... |
worker.py | import os
import subprocess
import json
import time
from multiprocessing import Lock, Process
from threading import Thread
import logging
import sys
import re
import zipfile
import colorama
from colorama import Fore, Back, Style
from .resumable import Resumable
from .loggable import Loggable
class Worker(Resumable,... |
log.py | # -*- coding: utf-8 -*-
"""
lantz.core.log
~~~~~~~~~~~~~~
Implements logging support for Lantz.
:copyright: 2018 by The Lantz Authors
:license: BSD, see LICENSE for more details.
"""
import pickle
import select
import socket
import struct
import logging
import threading
from logging import DEBU... |
tutorial.py | from pathlib import Path
from threading import Thread
from typing import List
from playsound import playsound
import boxed
from boxed.border import draw_boundary
def display_tutorial(lines: List[str]) -> None:
"""Wraps and prints tutorial text"""
print(boxed.terminal.clear, end="")
print(
boxed.... |
test_failure.py | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.utils
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_uti... |
run_ammeter.py | # listen_join_request, ListenJoinSuccessThreading
from ammeter.main import listen_ammeter_request
from ammeter.main import test_post
import threading
from gevent import monkey
monkey.patch_socket()
import gevent
if __name__ == '__main__':
# gevent.joinall([
# # gevent.spawn(listen_ammeter_request),
# ... |
articlecrawler.py | #!/usr/bin/env python
# -*- coding: utf-8, euc-kr -*-
from time import sleep
from bs4 import BeautifulSoup
from multiprocessing import Process
from exceptions import *
from articleparser import ArticleParser
from writer import Writer
import os
import platform
import calendar
import requests
import re
class ArticleCr... |
pos.py | #!/usr/bin/env python3
"""
This document is created by magic at 2018/8/17
"""
import time
import json
import threading
from hashlib import sha256
from datetime import datetime
from random import choice
from queue import Queue, Empty
from socketserver import BaseRequestHandler, ThreadingTCPServer
# need two queue
# 定... |
mymongodaemon.py | import sys
import time
import logging
import os
import configparser
from importlib import util
from multiprocessing import Process
from multiprocessing import Queue
from apscheduler.schedulers.blocking import BlockingScheduler
from mymongolib.daemon import Daemon
from mymongolib import mysql
from mymongolib.mongodb i... |
utils.py | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
threading_mixin_socket_server.py | import os
import socket
import threading
import socketserver
# we need to define encode function for converting string to bytes string
# this will be used for sending/receiving data via socket
encode = lambda text: text.encode()
# we need to define deocde function for converting bytes string to string
# this will con... |
thread3a.py | # thread3a.py when no thread synchronization used
from threading import Thread as Thread
def inc():
global x
for _ in range(1000000):
x+=1
#global variable
x = 0
# creating threads
t1 = Thread(target=inc, name="Th 1")
t2 = Thread(target=inc, name="Th 2")
# start the threads
t1.start()
t2.start()
#... |
test_run.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2020 tecnovert
# Distributed under the MIT software license, see the accompanying
# file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php.
import os
import time
import shutil
import logging
import unittest
import threading
from xmrswap.r... |
api.py | # Copyright 2013 OpenStack Foundation
# 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
#
# Un... |
no_loadgen.py | #!/usr/bin/env python3
import threading
import dataset
import argparse
import coco
import imagenet
import os
import argparse
import time
import cli_colors
import multiprocessing as mp
import pandas as pd
from queue import Queue
SUPPORTED_DATASETS = {
"imagenet":
(imagenet.Imagenet, dataset.pre_process_vgg... |
testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import os
import re
from shutil import rmtree
import string
import tempfile
from typing import Union, cast
import warnings
import zipfile
import numpy as np
from numpy.... |
discover.py | import ipaddress
import time
from os import getenv
from threading import Thread
from . import worker
def get_devices():
print('Finding WeMo devices...')
workers = worker.Workers(10, worker.ScanWorker, scan_timeout=2, connect_timeout=30, port=49153)
workers.start()
for addr in ipaddress.IPv4Network(g... |
app.py | import json
import os
import threading
import urllib.parse
import flask
import flask_talisman
import google.auth.transport.requests
import google.oauth2.id_token
import sheets
import sessions
ADMIN_ENABLED = bool(os.environ.get("LAM_ADMIN_ENABLED"))
ANALYTICS_ENABLED = bool(os.environ.get("LAM_ANALYTICS_ENABLED"))
A... |
app.py | """
* @author ['aroop']
* @email ['aroop.ghosh@tarento.com']
* @create date 2019-06-25 12:40:01
* @modify date 2019-06-25 12:40:01
* @desc [description]
"""
from flask import Flask, jsonify, request
import os
import glob
from datetime import datetime
import time
import logging
import math
import json
import uuid
... |
Transmitter.py | import os, sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
import threading
import time
from Communication_220114.Modules.Transmit import TransmitZMQ
tzo = TransmitZMQ.get_instance()
# tzo = TransmitZMQ.get_inst... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends: - CherryPy Python module (strongly recommend 3.2.x versions due to
an as yet unknown SSL error).
:optdepends: - ws4py Python module for websockets support.
:... |
debugger.py | import asyncio
import signal
import sys
import threading
from IPython.core.debugger import Pdb
from IPython.core.completer import IPCompleter
from .ptutils import IPythonPTCompleter
from .shortcuts import create_ipython_shortcuts, suspend_to_bg, cursor_in_leading_ws
from prompt_toolkit.enums import DEFAULT_BUFFER
fr... |
controller.py | # This file presents an interface for interacting with the Playstation 4 Controller
# in Python. Simply plug your PS4 controller into your computer using USB and run this
# script!
#
# NOTE: I assume in this script that the only joystick plugged in is the PS4 controller.
# if this is not the case, you will need t... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_adbclient.py | # -*- coding: UTF-8 -*-
#
# Tencent is pleased to support the open source community by making QTA available.
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may not use this
# file except in compliance with the License. You may... |
ps_drone.py | #########
# ps_drone.py
# (w)+(c) J. Philipp de Graaff, www.playsheep.de, drone@playsheep.de, 2012-2014
# Project homepage: www.playsheep.de/drone and https://sourceforge.net/projects/ps-drone/
# Dependencies: a POSIX OS, openCV2 for video-support.
# Base-program of the PS-Drone API: "An open and enhanced API for unive... |
natural_es.py | import torch
import torch.multiprocessing as mp
from torch.multiprocessing import SimpleQueue
import numpy as np
from utils import *
import pickle
from config import *
import time
class Worker(mp.Process):
def __init__(self, id, param, state_normalizer, task_q, result_q, stop, config):
mp.Process.__init__(... |
client.py | '''
trough/client.py - trough client code
Copyright (C) 2017-2019 Internet Archive
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later vers... |
mainwindow.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific Python Development Environment
=====================================================
Developed and maintained by the Spyder Proj... |
streams.py | import time,threading,requests
start=time.time()
URL = 'https://api.github.com/repos/{name}/{repo}/commits?page=1&per_page=100'
dict1 = {
'Zinko17':'RestProject',
'cholponesn':'StomCentr',
'aliyaandabekova':'THE_BEST_PRICE',
'zhumakova':'SportBetProject',
}
result = {}
def worker(username,repository):... |
A3C.py | """
Asynchronous Advantage Actor Critic (A3C) with continuous action space, Reinforcement Learning.
The Pendulum example.
View more on my tutorial page: https://morvanzhou.github.io/tutorials/
Using:
tensorflow 1.8.0
gym 0.10.5
"""
import multiprocessing
import threading
import tensorflow as tf
import numpy as np
impo... |
Tulsi.py | #!/usr/bin/env python
# Copyright (c) 2015 Vedams Software Solutions PVT 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... |
mhm2.py | #!/usr/bin/env python
# HipMer v 2.0, Copyright (c) 2020, 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."
# Redistribution and use in source and binary forms, with or... |
process_star_catalog.py | """Process star catalog produced by make_catalogs.py to add columns for DCR biases, chromatic
seeing biases, and chromatic diffraction limit biases. This script requires that the LSST CatSim
SED files are downloaded and that either the environment variable $CAT_SHARE_DATA (for older versions
of the LSST DM stack) or S... |
mod_view.py | # -*- mode: python; coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
#
# $Id$
"""Interactive image viewer for CSPad images
XXX Known issues, wishlist:
* Is it slow? Yes!
* Radial distribution plot, requested by Jan F. Kern
* Coordinate and resolution tool-tips in sub-pixel zoom. Can we
choose ... |
enterprise_backup_restore_test.py | import re
import copy
import json
from random import randrange, randint
from threading import Thread
from Cb_constants import constants
from couchbase_helper.cluster import Cluster
from membase.helper.rebalance_helper import RebalanceHelper
from couchbase_helper.documentgenerator import BlobGenerator, DocumentGenerato... |
stream_server.py | from imutils.video import VideoStream
from flask import Response
from flask import Flask
from flask import render_template
import threading
import argparse
import datetime
import imutils
import time
import cv2
outputFrame = None
lock = threading.Lock()
app = Flask(__name__)
vs = VideoStream(resolution=(240, 180), s... |
run_dqn_atari_log.py | import argparse
import gym
from gym import wrappers
import os.path as osp
import os
import time
import random
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers
from multiprocessing import Process
import dqn_log as dqn
from dqn_utils import *
from atari_wrappers import *
def atari_m... |
main.py | import threading
from time import sleep
import schedule
from newsweec.meta.logger import logging # noreorder
from newsweec.meta.logger import Logger # noreorder
from newsweec.bot.bot import get_user_from_user_handler
from newsweec.bot.bot import poll
from newsweec.news.news_collector import collect_news
DEBUG = ... |
common_utils.py | r"""Importing this file must **not** initialize CUDA context. test_distributed
relies on this assumption to properly run. This means that when this is imported
no CUDA calls shall be made, including torch.cuda.device_count(), etc.
torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported.... |
_Worker.py | #! /usr/bin/env python
# coding: utf-8
import os
import re
import sys
import signal
import json
import uuid
import types
import subprocess
from time import time, sleep
import threading
import logging
import traceback
from JYTools import StringTool
from JYTools.JYWorker.util import ValueVerify, ReportScene
from ._excep... |
sizecorr.py | '''
Created on May 15, 2018
@author: melnikov
'''
import numpy
import base64
from scipy import signal
import multiprocessing as mp
try:
from workflow_lib import workflow_logging
logger = workflow_logging.getLogger()
except:
import logging
logger = logging.getLogger("MeshBest")
def ... |
updateRelation.py | import json
from django.core.management.base import BaseCommand
from django.db import transaction
from postdb.models import *
from thulac import thulac
import threading, queue
thu = thulac(seg_only=True, rm_space=True)
cnt_thread = 10
timeout = 10
q = queue.Queue()
mutex = threading.Lock()
class Command(BaseCommand... |
test_celery.py | import threading
import pytest
pytest.importorskip("celery")
from sentry_sdk import Hub, configure_scope
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk._compat import text_type
from celery import Celery, VERSION
from celery.bin import worker
@pytest.fixture
def connect_signal(request... |
Main.py | '''
Main entry function for the overall python based server.
This will load in individual pipe sub-servers and run their threads.
Initial version just runs a test server.
'''
'''
Note on security:
Loading arbitrary python code can be unsafe. As a light protection,
the pipe server will only load modules that ... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence
from electrum.storage import WalletStorage, StorageReadWriteError
from electrum.wallet_db import WalletDB
from el... |
SuiteVisitorImportProxy.py | #
# Copyright 2017 Nokia Solutions and Networks
# Licensed under the Apache License, Version 2.0,
# see license.txt file for details.
#
import threading
import sys
import json
import types
import inspect
import re
from robot.api import SuiteVisitor
from robot.running import TestLibrary
from robot.running.testlibrarie... |
loadgen.py | #!python
import prestodb, time, threading
import time
# Change this array to include the queries you want to rotate through
queries = [ "select max(nationkey) from s3.s.nation",
"select min(partkey) from s3.s.part",
"select min(custkey) from s3.s.customer",
"select max(orderkey) from s3.s.orde... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
test_multi_thread_producer_consumer_sql_twitter.py | #!/usr/bin/env python
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
from multi_thread_producer_consumer_sql_twitter import ProducerConsumerThreadSqlTwitter
from os import path
import threading
APP_ROOT = path.dirname(path.abspath( __file__ ))
"""
This script for parallel command... |
test_runpyasrtseq.py | import sys
import threading
from niveristand import nivs_rt_sequence
from niveristand import realtimesequencetools
from niveristand.clientapi import DoubleValue, ErrorAction, RealTimeSequence
from niveristand.errors import RunAbortedError, RunFailedError, TranslateError
from niveristand.library import generate_error
fr... |
dashboard.py | import io
import base64
import threading
import traceback
import numpy as np
import scipy.io as sio
import pandas as pd
import dash
from dash_table import DataTable
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.exceptions import PreventUpdate
... |
Driver.py | #!/usr/bin/env python
# Copyright 2017 Battelle Energy Alliance, 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 appl... |
SecondLevel.py | import threading
from vkconnections import VkAPI as API
class SecondDivision:
def __init__(self, list_of_vk_script, token):
self.listOfVkScript = list_of_vk_script
self.token = token
self.data = []
def execute(self):
listOutput = []
for item in self.listOfVkScript:
... |
MapperController.py | '''
Created on Nov 22, 2021
@author: Japi42
'''
import threading
import time
from ECL_config import main_config
condition = threading.Condition()
def startup():
ut = threading.Thread(name='UpdateMappersThread', target=updateMappersThread, daemon=True)
ut.start()
def updateMappersThread():
print("Start... |
test_cassandra.py | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import threading
import time
from types import ListType
import unittest
import os
import mock
# 3p
from nose.plugins.attrib import attr
# project
from aggregator import MetricsAggregator
import logging... |
thread_worker_queue.py | import copy
import threading
import queue
class SingleTaskListener():
def __init__(self):
self.ev = threading.Event()
def wait(self):
self.ev.wait()
def notify(self, _id, _data):
self.ev.set()
class MultipleTaskListener():
def __init__(self, count):
self.count = 0
self.expected = co... |
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... |
test_general.py | """
Collection of tests for unified general functions
"""
# global
import os
import math
import time
import einops
import pytest
import threading
import numpy as np
from numbers import Number
from collections.abc import Sequence
import torch.multiprocessing as multiprocessing
# local
import ivy
import ivy.functional.... |
bakery_algorithm.py | from time import sleep
from random import randint
from threading import Thread
LOWEST_PRIORITY = 0
NUM_THREADS = 100
def lock(tid, entering, tickets):
# The entering list is required for the edge case where two threads end up
# getting the same ticket value, and one with lower prioirty (higher tid)
# en... |
isilon-onefs-ftp-exploit.py | #!/usr/bin/env python
#
# Exploit name : isilon-onefs-ftp-exploit.py
# Created date : 9/21/18
# Submit Date : 10/10/18
# Author : wetw0rk
# Header Wizard BOI : loganbest
# Python version : 2.7
# Brute Force Script: https://github.com/wetw0rk/Exploit-Development/blob/master/DELL%20EMC%20One... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Your bot is alive!"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
|
clock.py | from ..constants import DEFAULT_TEMPO, DEFAULT_TICKS_PER_BEAT, MIN_CLOCK_DELAY_WARNING_TIME
from ..util import make_clock_multiplier
import time
import logging
import threading
log = logging.getLogger(__name__)
#----------------------------------------------------------------------
# A Clock is relied upon to genera... |
scheduler_job.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
test_public.py | import unittest
import threading
from g1.asyncs import kernels
class KernelsTest(unittest.TestCase):
def test_contexts(self):
def test_with_kernel():
self.assertIsNotNone(kernels.get_kernel())
self.assertIsNone(kernels.get_kernel())
kernels.call_with_kernel(test_with_kerne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.