source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
streaming.py | import cv2
import socket
import pickle
import struct
import threading
class StreamingServer:
"""
Class for the streaming server.
Attributes
----------
Private:
__host : str
host address of the listening server
__port : int
port on which the server is list... |
base.py | import re
import threading
import time
import warnings
import weakref
from collections.abc import Mapping
from collections import OrderedDict
from functools import partial
import requests
from dateutil.parser import isoparse
from logbook import Logger
from represent import ReprHelper, ReprHelperMixin
from rush.quota i... |
server.py | import sys
sys.path.insert(0, '/home/mendel/emotion-mesh/cloud-detector')
sys.path.append('db')
import base64
import contextlib
import hashlib
import io
import os
import logging
import queue
import select
import socket
import struct
import subprocess
import threading
import time
from shutil import copyfile, move
from ... |
hub_mozita.py | #!/usr/bin/python3
import os
import json
import time
import datetime
import calendar
import telepot
import threading
import telegram_events
import tweepy as ty
from pathlib import Path
from datetime import datetime, timedelta
from configparser import ConfigParser
from telepot.loop import MessageLoop
from telepot.namedt... |
ctfdumper.py | import requests, queue, re, urllib.parse, json, threading, tqdm, time
import pandas as pd
class CTFDumper:
def __init__(self, url, threads=10):
self.url = url
self.threads_num = threads
self.tasks = queue.Queue()
self.results_submissions = queue.Queue()
self.results_users =... |
TCP_server_asyncio.py | import socket
import threading
import asyncio
import platform
class Server:
def __init__(self):
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server.setblocking(False)
self.server.bind(('0.0.0.0', 8000))
self.server.listen(1)
async def start_new_... |
main.py | # Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
server.py | import socket
from threading import *
import time
#Vector of clients
clients = []
#Detect an local ip adress
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
# doesn't even have to be reachable
s.connect(('10.255.255.255', 1))
IP = s.getsockname()[0]
except:
... |
main.py | print("""
[VALORANT-RPC] by restrafes
The source code for this project can be found at: https://github.com/restrafes/valorant-rpc
""")
# import libraries
import os, sys, psutil, traceback
import asyncio, threading
import pypresence, time
import json
from psutil import AccessDenied
from utils import open_game_client, g... |
prio_handler_rs1.py | '''
receives BGP messages and assign them to the set of SMPC workers
'''
import argparse
import json
from multiprocessing.connection import Listener, Client
import os
import Queue
from threading import Thread
import sys
np = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if np not in sys.path:
sys.p... |
libfibre.py | #!/bin/python
from ctypes import *
import asyncio
import os
from itertools import count, takewhile
import struct
from types import MethodType
import concurrent
import threading
import time
import platform
from .utils import Logger, Event
import sys
# Enable this for better tracebacks in some cases
#import tracemalloc... |
translate.py | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import languages
import threading
import pathlib
import speechTranslate as st
import textToSpeech as tts
import imageInterpreter as ii
# Translates input audio into English
def speechtranslate():
try:
targetLang = langVariable.ge... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum_bitcoinprivate import Wallet, WalletStorage
from electrum_bitcoinprivate.util import UserCancelled, InvalidPassword
from electrum_bitcoinprivate.base_wizard import B... |
xyolo.py | #!/usr/bin/env python
#
# // SPDX-License-Identifier: BSD-3-CLAUSE
#
# (C) Copyright 2018, Xilinx, Inc.
#
import os,sys,timeit,json
from multiprocessing import Process, Queue
# To control print verbosity
import logging as log
# Bring in some utility functions from local file
from yolo_utils import cornersToxywh,sigm... |
player.py | # -*- coding: UTF-8 -*-
import threading, time
from .model import *
class Player:
def __init__(self, color, name):
self._color = color
self._name = name
self._score = 0
@property
def color(self):
return self._color
@property
def name(self):
return self._n... |
rpc_ops_test.py | # Copyright 2021 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... |
test12.py | import zmq
import random
import sys
import time
from threading import Thread
def server():
port = "5556"
if len(sys.argv) > 1:
port = sys.argv[1]
int(port)
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://127.0.0.1:%s" % port)
while True:
soc... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_blk.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_blk.bip32 import BIP32Node
from electrum_blk import constants
from electrum... |
GraphComponentTest.py | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
handover.py | # Copyright (C) 2013 Sony Mobile Communications AB.
# All rights, including trade secret rights, reserved.
import json
import time
import traceback
from ave.network.process import Process
from ave.network.exceptions import *
from ave.broker._broker import validate_serialized, RemoteBroker, Broker
from ave.brok... |
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
except Exception:
# this is a test case write with tiny-test-fw.
# to run ... |
browser_pool.py | import threading
import time
from queue import Queue, Empty
import psutil as psutil
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
'''
* -------------------------------------------------
* * Browser_Pool
* @discribe : Browser Pool
*
* @author : Ma Xuefeng
* @date : ... |
app.py | #----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
from flask import Flask, render_template, request
# from flask.ext.sqlalchemy import SQLAlchemy
import logging
from logging import Formatter, FileHandl... |
worker_list.py | import time
from threading import Thread
import webbrowser
from dexbot import __version__
from dexbot.config import Config
from dexbot.controllers.wallet_controller import WalletController
from dexbot.views.create_wallet import CreateWalletView
from dexbot.views.create_worker import CreateWorkerView
from dexbot.views.... |
core.py | #! /usr/bin/python3
#
# Copyright (c) 2018 Sébastien RAMAGE
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
from binascii import hexlify
import traceback
from time import (sleep, strftime, monotonic)
import logging
import json
import os
f... |
python_ls.py | # Copyright 2017 Palantir Technologies, Inc.
import logging
import socketserver
import threading
from jsonrpc.dispatchers import MethodDispatcher
from jsonrpc.endpoint import Endpoint
from jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter
from . import lsp, _utils, uris
from .config import config
from .... |
pyshell.py | #! /usr/bin/env python3
import sys
if __name__ == "__main__":
sys.modules['idlelib.pyshell'] = sys.modules['__main__']
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
raise SystemExit(... |
kaliya.py | """Kalia image web scraper
Uses multiple methods to download images from specific source
"""
__version__ = '0.7'
__author__ = 'axell'
import math
import os
import re
import sys
from multiprocessing import Process, active_children
from pathlib import Path
from time import gmtime, sleep, strftime
import click
import... |
parse.py | import httpx
import threading
from lxml.etree import HTML
from getAPT import getAuthor, getPT
class Book:
def __init__(self, page=1):
self.ls = []
self.page = page
def _searchBook(self, title, page, publisher, author, isbn, year, doctype, lang_code, sort, orderby, onlylendable):
searchU... |
Hiwin_RT605_ArmCommand_Socket_20190627200136.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
utils.py | import datetime
import functools
import os
import sys
import threading
import warnings
def deprecated(func):
@functools.wraps(func)
def new_func(*args, **kwargs):
warnings.simplefilter('always', DeprecationWarning)
warnings.warn(
'Call to deprecated function {}.'.format(func.__name... |
test_recipes.py | """Test diskcache.recipes."""
import shutil
import threading
import time
import pytest
import diskcache as dc
@pytest.fixture
def cache():
with dc.Cache() as cache:
yield cache
shutil.rmtree(cache.directory, ignore_errors=True)
def test_averager(cache):
nums = dc.Averager(cache, 'nums')
f... |
main.py | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
reminder.py | import time
import keyboard
from playsound import playsound
import threading
def remainder_alarm(text, timeremind):
print("thread running..")
local_time = float(timeremind)
local_time = local_time * 60
time.sleep(local_time)
print(text)
print("Press Space to stop")
while True:
play... |
sunny_new_red_line_detect_simple_gazebo.py | #!/usr/bin/env python
from cv_bridge import CvBridge, CvBridgeError
from duckietown_utils.jpg import image_cv_from_jpg #location:f23-LED/led_detection/include
import threading
import rospy
import numpy as np
import cv2
import math
from sensor_msgs.msg import CompressedImage, Image
from ino_car.msg import LaneLine, Lan... |
Update_Internal_Remotly.py | from wakeonlan import send_magic_packet
from fabric import Connection
import marshal
import types
import threading
from queue import Queue
import socket
import time
import base64
import sys
import paramiko.ssh_exception
def starting_module(c_q):
print("###########################################")
print("## ... |
servers.py | # -*- coding: utf-8 -*-
# @Time : 2018/12/14 9:11
# @Author : Xiao
import socket,subprocess,struct,json,threading,time
ip_port= ("127.0.0.1",8081)
max_connect = 1
server_socket = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
serve... |
http_malleable.py | from __future__ import print_function
import base64
import copy
import json
import logging
import os
import random
import ssl
import string
import sys
import time
import urllib.parse
from builtins import object
from builtins import str
from typing import List
from flask import Flask, request, make_response, Response
... |
ContextTest.py | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... |
proc_reader.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2019~2999 - Cologler <skyoflw@gmail.com>
# ----------
#
# ----------
from threading import Thread, Lock, Condition
from subprocess import Popen
from queue import Queue
def _read_from_stream(stream, queue: Queue, tag):
def run():
for line in stream:
lin... |
email.py | from flask_mail import Message
from flask import current_app
from app import mail
from threading import Thread
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipients=recipients)
msg... |
md_browser.py | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Simple Markdown browser for a Git checkout."""
from __future__ import print_function
import SimpleHTTPServer
import SocketServer
im... |
RegisMaster.py | import threading
import os
from selenium import webdriver
from selenium.webdriver import ChromeOptions
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
from playsound import ... |
test_channel.py | #!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Used by test_channel.vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import time
import threading
try:
# Python 3
import socketserver
except ImportError:
#... |
LocalFileInterfaz.py | import pathlib
import hashlib
import shutil
import threading
import os
import logging
from pprint import pprint
from mutagen.easyid3 import EasyID3
class LocalFileInterfaz(object):
def __init__(self, dirsInput=[], dirOutput=None):
self.dirsInput = dirsInput
self.dirOutput = dirOutput
self.t... |
views.py | """Defines a number of routes/views for the flask app."""
from functools import wraps
import io
import os
import sys
import shutil
from tempfile import TemporaryDirectory, NamedTemporaryFile
import time
from typing import Callable, List, Tuple
import multiprocessing as mp
import zipfile
from flask import json, jsonif... |
run_test_package.py | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Contains a helper function for deploying and executing a packaged
executable on a Target."""
from __future__ import print_function
import common
import h... |
lunartime.py | import json
import logging
import threading
from const import DATA_FILE_EXT, UTC
from datetime import datetime, time, timedelta
from envvarname import EnvVarName
from pathlib import Path
from pylunar import MoonInfo
from pytz import timezone, utc
from time import sleep
from twitter import TwitterUtil
from ... |
DIH_fast.py | #!/usr/bin/env python
import sys
sys.path.append('/root/caffe/python')
import caffe
import numpy as np
from PIL import Image
import os
import time
import cv2
import numpy as np
import scipy as sp
import scipy.ndimage
import socket
import socketserver # socketserver in Python 3+
import time
from queue import Queue
from... |
test_gc.py | import unittest
from test.support import (verbose, refcount_test, run_unittest,
strip_python_stderr, cpython_only, start_threads,
temp_dir, requires_type_collecting, TESTFN, unlink)
from test.support.script_helper import assert_python_ok, make_script
import sys
impor... |
util.py |
import time
class MessageDecode:
def __init__(self, buf):
self.buf = buf
self.pos = 0
self.message = {}
def __len__(self):
return len(self.buf)
def int_(self):
res = 0
i = 0
while self.buf[self.pos] >= 128:
res = res | (127 & self.buf[... |
multipcheck.py | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 6 18:45:21 2019
@author: admin
"""
from multiprocessing import Lock, Process, Queue, current_process
import time
import queue # imported for using queue.Empty exception
def do_job(tasks_to_accomplish, tasks_that_are_done):
while True:
try:
... |
sound.py | from multiprocessing import Process, Queue, Value, Semaphore
def get_val(regs, val):
if val.isalpha():
return regs[val]
else:
return int(val)
def second(instructions, send, receive, counter, sem, default):
regs = {}
i = 0
while 0 <= i < len(instructions):
instr = instructi... |
test_consumer_group.py | import collections
import logging
import threading
import time
import pytest
import six
from kafka import SimpleClient
from kafka.conn import ConnectionStates
from kafka.consumer.group import KafkaConsumer
from kafka.structs import TopicPartition
from test.conftest import version
from test.testutil import random_str... |
test_search.py | import time
import pdb
import copy
import logging
from multiprocessing import Pool, Process
import pytest
import numpy as np
from pymilvus import DataType
from utils import *
from constants import *
uid = "test_search"
nq = 1
epsilon = 0.001
field_name = default_float_vec_field_name
binary_field_name = default_binary... |
upload_directory.py | #!/usr/bin/env python2
# coding: utf-8
import datetime
import errno
import getopt
import logging
import os
import sys
import threading
import time
import yaml
import boto3
from boto3.s3.transfer import TransferConfig
from botocore.client import Config
from pykit import jobq
MB = 1024**2
GB = 1024**3
mega = 1024.0 ... |
run.py | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... |
executor.py | """HighThroughputExecutor builds on the Swift/T EMEWS architecture to use MPI for fast task distribution
"""
from concurrent.futures import Future
import typeguard
import logging
import threading
import queue
import pickle
from multiprocessing import Process, Queue
from typing import Dict, List, Optional, Tuple, Union... |
ragno.py |
import subprocess
import requests
import argparse
import numpy as np
import threading
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;35m', '\033[1;32m', '\033[0m'
"""
Crawl Source:
=============
1. web.archive.org
2. index.commoncrawl.org
3. otx.ali... |
vnhuobi.py | # encoding: utf-8
import urllib
import hashlib
import gzip
import zlib
import json
import requests
from time import time, sleep
from Queue import Queue, Empty
from threading import Thread
import websocket
# 常量定义
COINTYPE_BTC = 1
COINTYPE_LTC = 2
ACCOUNTTYPE_CNY = 1
ACCOUNTTYPE_USD = 2
LOANTYPE_CNY = 1
LOANTYPE_BT... |
analyse_terms.py | #########################################################################################################################################
# IMPORTS ###############################################################################################################################
from collections import Counter
import os,sy... |
Startup.py | import sys
import os
sys.path.insert(-1, os.path.expanduser("~/Documents"))
sys.path.insert(-1, os.path.expanduser("~/Documents/modules"))
import io
import console
import code
import pyto
from importlib.machinery import SourceFileLoader
import importlib
import threading
from time import sleep
from outputredirector im... |
submission.py | from __future__ import print_function
import grasp
import ensemble
import importlib
import sys
import os
import subprocess
from multiprocessing import Process
import yaml
import json
import argparse
with open("SETTINGS.json") as file:
config = json.load(file)
with open("final_nets.yml") as file:
all_net_kwar... |
manager.py | # Copyright 2019 The OpenSDS 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 ... |
boost.py | # -*- coding: utf-8 -*-
from lcu_driver import Connector
import tkinter as tk
from tkinter import messagebox
import threading, os
__author__: str = "R3nzTheCodeGOD"
__version__: str = "1.0.4"
window = tk.Tk()
client = Connector()
name = ""
buttonClick = False
window.title("ARAM Boost")
window.geometry("300x150")
win... |
speculbot.py | import yfinance as yf
import requests
from threading import Event, Thread
from yfinance.ticker import Ticker
class BotTicker:
def __init__(self, symbol: str):
self._name = symbol
self._states = [-1]
self._result = -1
def add_state(self, state: int):
self._result = state
... |
web_socket_server.py | ## Author: Victor Dibia
## Web socket server. Used to send socket messages to a connected clients.
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from threading import Thread
import time
retry_threshold = 5
socket_url = "127.0.0.1"
socket_port = 5006
clients = []
class SockerServer(WebSocket):
... |
test_streams.py | """Tests for streams.py."""
import gc
import os
import queue
import pickle
import socket
import sys
import threading
import unittest
from unittest import mock
from test.support import socket_helper
try:
import ssl
except ImportError:
ssl = None
import asyncio
from test.test_asyncio import utils as test_utils
... |
bot.py | import discord, os, asyncio, pyosu, textwrap, osu_irc, re
from discord.ext import commands
from helpers.config import config
from helpers.parse import parse_args
from helpers.classify import Classify
from helpers.command import parse_commands, init_commands
from helpers.db import ban_user, get_bugs, get_suggestions, ge... |
test_server.py | import os
from multiprocessing.managers import DictProxy
import requests
import time
import tempfile
import uuid
from typing import List, Text, Type, Generator, NoReturn
from contextlib import ExitStack
from _pytest import pathlib
from aioresponses import aioresponses
import pytest
from freezegun import freeze_time... |
singleton.py | import time
import threading
# 打印缓冲区锁
# print buffer lock
print_lock = threading.Lock()
class Singleton():
_instance_lock = threading.Lock()
def __init__(self):
time.sleep(1)
pass
@classmethod
def instance(cls):
Singleton._instance_lock.acquire()
if n... |
client_runner.py | """
Copyright 2019-2020 Pelion.
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, software
dist... |
air_sim_to_mavlink.py | # Install required packages:
#
# pip3 install pymavlink
# pip3 install apscheduler
# pip3 install opencv-python
# pip3 install airsim
# pip3 install numpy
# sudo apt-get install python-PIL
import math
import sys
import time
import airsim
from cv2 import cv2
import numpy as np
from PIL import Image
import... |
basic.py | # -*- coding: utf-8 -*-
"""
flask.testsuite.basic
~~~~~~~~~~~~~~~~~~~~~
The basic functionality.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
import uuid
import flask
import pickle
import unittest
from datetime import datetime
from threading i... |
main.py | from tkinter import Tk, Button, Label
from threading import Thread
from queue import Queue
import configparser
import sys
import os
def init_config(path):
config.optionxform = str
config.read(path)
def maingui():
for name in tt['modules'].keys():
tt[name]['label'].config(text=str(tt[name].get('c... |
app.py | #!/usr/local/bin/python
import sys
import flaskwebgui
from flask import *
import read_mindwave_mobile
import threading
import att_model , lowa_model , lowb_model
import matplotlib.pyplot as plt
app = Flask(__name__)
ui = flaskwebgui.FlaskUI(app)
class datapackMW :
Delta = []
Theta = []
LowAlph... |
speed.py |
from time import sleep, perf_counter
from threading import Thread
def task1():
count = 111111
while True:
if count == 222221:
break
count += 1
def task2():
count = 222222
while True:
if count == 333332:
break
count += 1
def t... |
queue_threads.py | import unittest
import json
import time
from functools import wraps
from threading import Thread, Lock
from app import app
from data.queue import WorkQueue
from initdb import wipe_database, initialize_database, populate_database
QUEUE_NAME = 'testqueuename'
class AutoUpdatingQueue(object):
def __init__(self, que... |
huji_cheese.py | import datetime
import json
import os
from threading import Thread
from urllib.parse import urlsplit
from flask import Flask, render_template, request, redirect
from cheese_proxied_browser import CheeseProxiedBrowser
from collectors import DigmiAllCoursesCollector
from downloader import download_courses, COURSE_FILE_... |
setup_cassandra.py | """
The MIT License (MIT)
Copyright (c) 2016 Datos IO, Inc.
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, modify, merge... |
test_interactions_websockets.py | import asyncio
import logging
import time
import unittest
from random import randint
from threading import Thread
from typing import Optional
from slack_sdk.socket_mode.request import SocketModeRequest
from slack_sdk.socket_mode.async_client import AsyncBaseSocketModeClient
from slack_sdk.socket_mode.websockets impor... |
test_generator_mt19937.py | import sys
import pytest
import numpy as np
from numpy.linalg import LinAlgError
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_allclose,
assert_warns, assert_no_warnings, assert_array_equal,
assert_array_almost_equal, suppress_warnings)
from numpy.random import Generator, MT199... |
_kubeless.py | #!/usr/bin/env python
import importlib
import io
import os
import queue
import sys
import bottle
import prometheus_client as prom
# The reason this file has an underscore prefix in its name is to avoid a
# name collision with the user-defined module.
current_mod = os.path.basename(__file__).split('.')[0]
if os.gete... |
executor.py | # Copyright 2019 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 applicable law or agreed to ... |
profinet_set_ip.py | from icssploit import (
exploits,
print_success,
print_status,
print_error,
validators,
)
import threading
from icssploit.thirdparty import tabulate
from icssploit.protocols.pn_dcp import *
from scapy.arch import get_if_hwaddr
from scapy.sendrecv import sendp, sniff
TABLE_HEADER = ['Device Name', ... |
fulcrum_task_runner.py | from __future__ import absolute_import
from hashlib import md5
from django.core.cache import cache
from multiprocessing import Process
import time
import django
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.db import OperationalError
import json
class FulcrumTas... |
http_server.py | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
prte.py |
__copyright__ = "Copyright 2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import time
import logging
import threading as mt
import subprocess as mp
import radical.utils as ru
from .base import LaunchMethod
# ------------------------------------------------------------------------------
... |
Algorithm.py | import pygame
import threading
from queue import PriorityQueue
from pygame.locals import *
import Commons
import Position
import GameWindow
def CalculatePathBasedOnCurrentAlgorithm (tree, start, end, window):
isCurrentAlgorithmAStar = Commons.CurrentAlgorithm == Commons.A_ALGORITHM
queue = PriorityQueue()
... |
test_request.py | # flake8: noqa
import threading
import asyncio
import aiohttp_jinja2
from urllib import request
from nose.tools import eq_
from aiohttp.test_utils import unittest_run_loop
from ddtrace.pin import Pin
from ddtrace.constants import EVENT_SAMPLE_RATE_KEY
from ddtrace.contrib.aiohttp.patch import patch, unpatch
from ddtr... |
dataloader_webcam.py | import os
import torch
from torch.autograd import Variable
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image, ImageDraw
from SPPE.src.utils.img import load_image, cropBox, im_to_torch
from opt import opt
from yolo.preprocess import prep_image, prep_frame, inp_to_i... |
pylapse.py | import libsonyapi
from libsonyapi.actions import Actions
from libsonyapi.camera import Camera, ConnectionError
import tkinter as tk
from tkinter import messagebox
import threading
import time
import datetime
import os
pylapse_font = ("Trebuchet", 14)
class CustomLabel(tk.Label):
"""
defines a custom label us... |
mac_kicker.py | #!/usr/bin/env python3
#
# MIT
# ciko@afra-berlin.de
# kookie@spacekookie.de
import asyncio
import datetime
import subprocess
import sys
import time
import threading
import evdev
import hashlib
import pydle
import requests
from rpi_ws281x import *
def mac_tester():
global current_mac_users, current_rfid_users
... |
__init__.py | """Web client to monitor pipeline processes for PyPPL"""
from threading import Thread
from pathlib import Path
from flask_socketio import SocketIO
from diot import Diot
from pyppl.plugin import hookimpl
from pyppl.logger import Logger
from pyppl.config import config
from .shared import (logger, PLUGIN, DEFAULT_PORT, DE... |
curses_ui_test.py | # Copyright 2016 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... |
nodefinder.py | from threading import Thread, Lock
from time import perf_counter
from sys import stderr
from time import sleep
import socket, requests
BASE_IP = "192.168.1.%i"
CHECKPORT = 18623
SERVERPORT = 18623
IPS = []
activenodes = []
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
# doesn... |
websocket.py | import asyncio
import json
import logging
import os
from threading import (
Thread,
)
from types import (
TracebackType,
)
from typing import (
Any,
Optional,
Type,
Union,
)
from eth_typing import (
URI,
)
from websockets.client import (
connect,
)
from websockets.legacy.client import (... |
pants_daemon.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os
import sys
import threading
from contextlib import contextmanager
from setproctitle import setproctitle as set_process_title
from pants.base.build_environment im... |
wsideidentifier.py | #!/usr/bin/env python
# for mac: //instructions from https://opensource.com/article/19/5/python-3-default-mac
# //UNINSTALL HOMEBREW VERSIONS OF PYTHON FIRST!!
# $ brew install pyenv //manages python environments to avoid messy system environment
# $ pyenv install <version> //whatever version you want - 3.8.2 as of 3/... |
slp_graph_search.py | """
SLP Graph Search Client
Performs a background search and batch download of graph
transactions from a Graph Search server. For more information about
a Graph Search server see:
* gs++: https://github.com/blockparty-sh/cpp_slp_graph_search
* bchd: https://github.com/simpleledgerinc/bchd/tree/graphsearch
This class... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.