source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
relay.py | import sys
import socket
import threading
import time
from optparse import OptionParser
import os
import Queue
import re
import logging
import requests
import base64
from app.status import Status
from app.broadcaster import Broadcaster
from app.httprequesthandler import HTTPRequestHandler
from app.streaming import WebS... |
bridge_manager.py | #!/usr/bin/env python3
"""
This module contains the BridgeManager class.
"""
import os
import signal
from queue import Empty
from threading import Lock, Thread, current_thread
from time import sleep
from typing import List
from bridge import Bridge
from config import Config
class BridgeManager:
"""
This clas... |
app.py | from flask import Flask, request,jsonify
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
import tensorflow_hub as hub
from google.cloud import vision
import numpy as np
import webcolors
import threading
from translate import Translator
from PIL import Image, ImageOps
ap... |
testing_utils.py | """
weasyprint.tests.testing_utils
------------------------------
Helpers for tests.
"""
import contextlib
import functools
import logging
import os.path
import sys
import threading
import wsgiref.simple_server
import pytest
from .. import CSS, HTML, text
from ..logger import LOGGER
from ..urls import ... |
screens.py | import asyncio
from decimal import Decimal
import threading
from typing import TYPE_CHECKING, List, Optional, Dict, Any
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.recycleview import Recycl... |
TestPythonParaViewWebMPI.py | #/usr/bin/env python
# Global python import
import exceptions, traceback, logging, random, sys, threading, time, os
# Update python path to have ParaView libs
build_path='/Volumes/SebKitSSD/Kitware/code/ParaView/build-ninja'
sys.path.append('%s/lib'%build_path)
sys.path.append('%s/lib/site-packages'%build_path)
# Pa... |
server.py | import os
import numpy
import threading
import time
from multiprocessing import Process, Pipe, Event
from . import rq
from . import ur
from .sim.ur_rq3 import SimEnv
def start(config):
con = InProcHost(config) if config.get("in_proc", False) else RemoteHostProxy(config)
con.start()
return con
class InProc... |
ManagerNode.py | from multiprocessing.managers import BaseManager
from ControlNode.URLManager import URLManager
from ControlNode.DataOutput import DataOutput
from ControlNode.URL import URL
import time
from multiprocessing import Process
from multiprocessing import Queue
class ManagerNode(object):
"""
url_q:url管理进程... |
detect.py | import cv2
import time
from datetime import datetime
import threading
from concurrent.futures import Future
import pandas as pd
class Detect:
cam_names_dict = {}
def __init__(self):
self.cam_names_dict = {}
path = "data\\csv\\img_taken_per_day.csv"
self.df = pd.read_csv(path, index=Fa... |
test_sys.py | # -*- coding: iso-8859-1 -*-
import unittest, test.test_support
import sys, os, cStringIO
import struct
import operator
class SysModuleTest(unittest.TestCase):
def tearDown(self):
test.test_support.reap_children()
def test_original_displayhook(self):
import __builtin__
savestdout = sy... |
main.py | from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
import random,os,datetime
import requests
import threading
app = Flask(__name__)
CURRENT_VERSION = ['7-23-2021']
DISCORD_KEY = os.environ['DISCORD_KEY'] #to send requests to the secondary server
app.config['SQLALCHEMY_DATABASE_URI'] = os.envir... |
main.py | #%%
import geopandas as gpd
import pandas as pd
import numpy as np
import json
from threading import Thread
from flask import Flask, render_template
from tornado.ioloop import IOLoop
from bokeh.models import (CDSView, ColorBar, ColumnDataSource,
CustomJS, CustomJSFilter, Div,
... |
console.py | #-*- coding: utf-8 -*-
# stino/console.py
import sublime
import threading
from . import constant
class Console:
def __init__(self, name = 'stino_console'):
self.name = name
self.panel = None
self.show_text = ''
def getName(self):
return self.name
def setName(self, name):
self.name = name
def printT... |
test_multithreads.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# DATE: 2021/11/13
# Author: clarkmonkey@163.com
import random
import threading
import pytest
from cache3 import SafeCache, DiskCache, SimpleDiskCache, JsonDiskCache
def generator():
for _ in range(random.randint(10, 20)):
threads: int = random.randint(8, 32)
... |
test_sys.py | # -*- coding: iso-8859-1 -*-
import unittest, test.test_support
import sys, cStringIO, os
import struct
class SysModuleTest(unittest.TestCase):
def test_original_displayhook(self):
import __builtin__
savestdout = sys.stdout
out = cStringIO.StringIO()
sys.stdout = out
dh = ... |
labours.py | #!/usr/bin/env python3
import argparse
from datetime import datetime, timedelta
from importlib import import_module
import io
import json
import os
import re
import shutil
import sys
import tempfile
import threading
import time
import warnings
try:
from clint.textui import progress
except ImportError:
print("W... |
test_mthread.py | import khmer, sys, threading, time
###
s = set()
def read_names(rparser, tnum):
print 'started', tnum
n = 0
for n, read in enumerate(rparser):
s.add(read.name)
if n % 1000 == 0:
print 'sleeping', tnum, n
time.sleep(0.2)
print 'done', tnum, 'got', n
###... |
utils.py | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... |
__init__.py | import binascii
import logging
import os
import os.path
import pty
import resource
import struct
import termios
import threading
import tty
import xml.etree.ElementTree as ET
from typing import IO, Any, Dict, List, Optional, Tuple, Union
from cle import ELF
from pygdbmi.gdbcontroller import GdbController
from ..error... |
query_dialog.py | ##########################################################################
# MediPy - Copyright (C) Universite de Strasbourg
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for de... |
cost_matrix_probe.py | #!/usr/bin/env python
# it takes list of active xrootd doors from AGIS, copy a file from each of them
# uploads MiB/s results to UChicago costmatrix storage
import subprocess
import threading
import os
import sys
import random
import math
import logging
import time
import urllib
import urllib2
import json as simplej... |
tello.py | from multiprocessing import synchronize
import os
import signal
import socket
import threading
import time
from stats import Stats
import sys
lock = threading.Lock()
class Tello:
def __init__(self):
self.local_ip = ''
self.local_port = 8889
self.socket = socket.socket(socket.AF_INET, soc... |
do_lock.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time, threading
# :
balance = 0
lock = threading.Lock()
def change_it(n):
# :
global balance
balance = balance + n
balance = balance - n
def run_thread(n):
for i in range(100000):
# :
lock.acquire()
try:
... |
asynchronous-computations.py | #!/usr/bin/env python
from time import sleep
from multiprocessing import Process, Queue
# Function naming convention is as follows:
# u - undefined, t - True, f - False
# first letter = result if argument is True
# second letter = result if argument is False
def uu(argument, processes_results_queue):
whi... |
command_handler.py | import threading
from enum import Enum
from inviter import Inviter
from invitee import Invitee
from utils import run_coroutine
class Action(Enum):
START_CONNECTION_AS_INVITER = "start_connection_as_inviter"
START_CONNECTION_AS_INVITEE = "start_connection_as_invitee"
GET_CONNECTION_STATE = "get_connection... |
dN_dS_ratioServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
runCtaTrading.py | # encoding: UTF-8
# 重载sys模块,设置默认字符串编码方式为utf8
import sys
# reload(sys)
# sys.setdefaultencoding('utf8')
import multiprocessing
from time import sleep
from datetime import datetime, time
from hsstock.vnpy.event.event_engine import EventEngine2
from hsstock.vnpy.trader.vtEvent import EVENT_LOG, EVENT_ERROR
from hsstock... |
fast_api_depends_test.py | import os
import sys
from attr import s
from websockets.exceptions import InvalidStatusCode
# Add parent path to use local src as package for tests
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
import time
import asyncio
from multiprocessing import Process
import pytest
... |
simple_server_tcp.py | import socket
import threading
bind_ip = '0.0.0.0'
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print("[*] listening on {}:{}".format(bind_ip, bind_port))
#client handling thread starts here
def handle_client(clie... |
util_cmd.py | # -*- coding: utf-8 -*-
r"""
This module exposes the :func:`ubelt.cmd` command, which provides a simple
means for interacting with the commandline. While this does use
:class:`subprocess.Popen` under the hood, the key draw of :func:`ubelt.cmd` is
that you can capture stdout/stderr in your program while simultaneously
p... |
demo.py | import threading
import time
def worker(x):
tid = threading.currentThread().name;
print("x = {} in {}".format(x, tid))
time.sleep(5)
# create the tread
tr = threading.Thread(target=worker, args=(42,))
# start the thread:
tr.start()
# wait until thread terminates:
tr.join()
print("Worker did its job!") |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner 3.0 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from threading import Semaphore
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
... |
mixedTest.py | import os
import sys
import threading
import time
log_path = '$ALLUXIO_HOME/python/TieredStoreLogs/'
file_name = 'iostat_log.txt'
def io_stat():
# if os.path.exists(log_path+file_name):
# os.system('rm '+log_path+file_name)
os.system('touch '+log_path+file_name)
os.system('ssh master iostat -d -x -... |
common.py | # Copyright 2021 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from enum import Enum
from functools import wraps
from pathlib import... |
AlarmClock.py | import core
import time
from plyer import notification
from datetime import datetime,date
import threading
allAlarm=[]
class AlarmClock:
monday:bool =False
tuesday:bool =False
wednesday:bool =True
thursday:bool =False
friday:bool =False
saturday:bool =False
sunday:bool =False
enabled... |
TProcessPoolServer.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... |
edgeDetect.py | import numpy as np
import cv2
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
from threading import Thread
frameWidth = -1
frameHeight = -1
mutableLineMessage = "Unknown"
def captureGenerator(cap) :
while (True):
global frameHeight, frameWidth
ret, frame = cap.read()
frameWidt... |
test_client.py | import asyncio
import contextlib
import functools
import gc
import inspect
import logging
import os
import pickle
import random
import subprocess
import sys
import threading
import traceback
import warnings
import weakref
import zipfile
from collections import deque
from contextlib import suppress
from functools import... |
subproc_vec_env.py | import multiprocessing
from collections import OrderedDict
import gym
import numpy as np
from stable_baselines.common.vec_env import VecEnv, CloudpickleWrapper
from stable_baselines.common.tile_images import tile_images
def _worker(remote, parent_remote, env_fn_wrapper, n_envs):
parent_remote.close()
envs =... |
attack.py | """The code is to conduct non-targeted adversarial attack."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import ConfigParser
import numpy as np
import os
import timeit
import tensorflow as tf
from itertools import izip
from Queue impor... |
multiprocessing_examples.py | # threads = [threading.Thread(target=download_images_partial, args=(queue,)) for i in range(n_threads)]
#
#
# for thread in threads:
# thread.start()
# for thread in tqdm(threads):
# thread.join()
# multiprocessing.log_to_stderr()
# logger = multiprocessing.get_logger()
# logger.setLevel(logging.INFO)
# pool ... |
test_config.py | import asyncio
import copy
import pytest
import random
import yaml
from ethgreen.util.config import create_default_ethgreen_config, initial_config_file, load_config, save_config
from ethgreen.util.path import mkdir
from multiprocessing import Pool
from pathlib import Path
from threading import Thread
from time import ... |
BinarySearch.py | import threading, queue
def binary_search_thread(item):
while True:
try:
list_item, index = work.get(False)
except queue.Empty:
return
if list_item == item:
set_results(True, index, item)
def build_que(search_list):
for i in range(len(search_list))... |
resnet.py | from keras.applications import ResNet50
from keras.preprocessing.image import img_to_array
from keras.applications import imagenet_utils
from threading import Thread
from PIL import Image
import numpy as np
import base64
import flask
import redis
import uuid
import time
import json
import sys
import io
IMAGE_WIDTH = 2... |
tortest2.py | ################### Tor test ################
# Warning: actually HTTPBrowser try to use Tor but on server which doesn't have tor installed, it will use the public ip of the server, the test proof:
# from domainduplicate import config as ddConf
# ddConf.useMongodb = False
# from systemtools.basics import *
# from hjweb... |
test_dockerDNS.py | #!/usr/bin/env/python3
import docker
import time
import os
import signal
from twisted.trial.unittest import TestCase
from multiprocessing import Process
from dockerDNS import DockerDNS
from dnslib.dns import DNSRecord
from ipaddress import ip_address, ip_network, IPv6Address
CLIENT = docker.from_env()
def resolveDN... |
mixins.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
=============
Class Mix-Ins
=============
Some reusable class Mixins
'''
# pylint: disable=repr-flag-used-in-string
# Import python libs
from __future__ import absolute_import, print_function
import os
import sys... |
asyser.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
由于zigbee设备发送和接收的数据是串行的方式
而用于用户交互的通信采用http是异步的方式
用户发送的指令需要通过http传到主控,再通过zigbee方式发送到终端设备
这个库的作用是将串行的串口数据与异步的http请求进行匹配
'''
import time
import serial
import threading
from threading import Lock
def asy(func):
''' 这是个装饰器函数用于开启一个新的线程
@Param: func 用于装饰的函数
'... |
multiprocessing_test.py | # coding=utf-8
# Copyright 2018 The TF-Agents 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... |
arduidomx.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import serial
from socket import *
import time
import subprocess
import os
import optparse
import sys
import signal
import logging
import re
import xml.dom.minidom as minidom
from Queue import Queue
from threading import Thread
__author__ = 'bmasquelier cedric02'
#
# Python... |
common_video.py | # coding=utf-8
# Copyright 2021 The Tensor2Tensor 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... |
cpu_apriltag_library.py | # python standard libraries
import logging
import time
import multiprocessing
import os
# pip installed packages
import numpy
from setproctitle import setproctitle
from colored import fore, back, style
from pupil_apriltags import Detector
from loguru import logger
from capture_device import CaptureDevice
# camera_... |
file_pusher.py | import collections
import os
import shutil
import threading
import time
from six.moves import queue
import warnings
import tarfile
import wandb
import wandb.util
from wandb.compat import tempfile
def resolve_path(path):
try:
from pathlib import Path
return str(Path(path).resolve())
except:
... |
weight-graph.py | #!/usr/bin/env python3
import sys
import tkinter as tk
import tkplot
import threading
from queue import Queue, Empty
import serial
import struct
from collections import namedtuple
import time
import csv
import math
def execute_delayed(root, generator):
"""For each yielded value wait the given amount of time (in s... |
syscall.py | # Copyright (c) 2014 ITOCHU Techno-Solutions Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
spin.py | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
import functools
import os
import signal
import sys
import threading
import time
from io import StringIO
import colorama
import six
from .compat import to_native_string
from .cursor import hide_cursor, show_cursor
from .misc import decode_... |
main.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009- Spyder Project Contributors
#
# Distributed under the terms of the MIT License
# (see spyder/__init__.py for details)
# --------------------------------------------------------------------------... |
python_instance.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... |
Camera.py | # Camera Class
# Brandon Joffe
# 2016
#
# Copyright 2016, Brandon Joffe, 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.... |
reservation.py | # Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""This module contains client/server methods to manage node reservations during TFCluster startup."""
from __future__ import absolute_import
from __future__ import division
from _... |
test_pooling.py | # Copyright 2009-2012 10gen, 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,... |
MultipleStepsMigrationNexus3Test.py | import unittest
from multiprocessing import Process
import engine.DataGenerationFunctions as DataGenerationFunctions
import engine.SharedTestFunctions as SharedTestFunctions
'''
Test multiple steps data migration for Nexus 3
'''
class MultipleStepsMigrationNexus3Test(unittest.TestCase):
def setUp(self):
... |
camera_monitor.py | """
camera_monitor.py: Original work Copyright (C) 2021 by Blewett
MIT License
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 us... |
ofreg.py | # Copyright (c) 2020 Scott Moisik and Pertti Palo.
#
# When making use of this code, please cite (TODO There might be a more appropriate place for these. Placed here temporarily):
# [1] Esling, J. H., & Moisik, S. R. (2012). Laryngeal aperture in relation to larynx height change: An analysis using simultaneous laryng... |
uWServer.py | #!/bin/env python3
'''
'''
# 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 ... |
BB8.py | #!/usr/bin/python
'''
Created on Mar 16, 2015
@author: selly
'''
import RPIO as GPIO #@UnresolvedImport
from RPIO import PWM #@UnresolvedImport
import time
import threading
import BB8Server
from logging import root
class BB8Controller(object):
'''
classdocs
'''
def __init__(self):
'''... |
emulator.py | #!/usr/bin/env python3
"""
MIT License
Copyright (c) 2021 Alexander Barbie
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, co... |
kblogging.py | """
Common narrative logging functions.
To log an event with proper metadata and formatting use 'log_event':
You can also do free-form logs, but these will be ignored by
most upstream consumers.
"""
import collections
import logging
from logging import handlers
import os
import threading
import time
# Local
from .u... |
UninstallAppService.py | from threading import Thread
from src.commands.database.DeleteAgentCommand import DeleteAgentCommand
from src.services.Service import Service
from src.utilities.database import db_session
class UninstallAppService(Service):
def __init__(self, slack_team_id):
super().__init__()
self.slack_team_id ... |
qlheartbeat.py | from threading import Thread
import time
class QLHeartbeat:
def __init__(self,logger,beatinterval,timeout,precision=0.1,level=20):
self.__logger__=logger
self.__bint__=beatinterval
self.__timeout__=timeout
self.__message__="Heartbeat"
self.__thread__=None
self.__keep... |
frontend.py | import os
import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox
from tkinter import ttk
import pandas as pd
import xlsxwriter
import threading
import time
import requests
from lib_TableReader import TableReader
import verimail
__title = "Verimail"
inputFileTypes = [('Valid files', ['*.... |
server.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import threading
from thriftpy.protocol import TBinaryProtocolFactory
from thriftpy.transport import (
TBufferedTransportFactory,
TTransportException
)
logger = logging.getLogger(__name__)
class TServer(object):
def __init_... |
HiwinRA605_socket_ros_test_20190625185856.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
__main__.py | #!/usr/bin/env python3
'''
* Copyright (C) 2019-2020 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
'''
import sys
from threading import Thread
import connexion
from vaserving.common.utils import logging
from vaserving.vaserving import VAServing
logger = logging.get_logger('main', is_static=True)
def ... |
websocketApi3.py | # -*- coding: utf-8 -*-
import websocket
import gzip
import time
import StringIO
import json
import zlib
import json
from threading import Thread
from urlparse import urlparse
import hmac
import hashlib
import requests
import os
import warnings
from Queue import Queue, Empty
SECRET = 'tRJs6HQP-cnpMnEB7-T9xRGOGM-TOusH... |
ib_broker.py | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... |
stats.py | """Module of various stats data manager."""
import traceback
from datetime import datetime, tzinfo, timedelta
from threading import Thread
from typing import Any, Optional, Union, List, Dict, Set
import pymongo
from bson import ObjectId
from env_var import is_testing
from extutils import dt_to_objectid
from extutils.... |
unzip2.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
多线程
'''
import zipfile
import optparse
from threading import Thread
def extractFile(zFile, password):
try:
zFile.extractall(pwd=password.encode("ascii"))
print('[+] Password = ' + password + '\n')
except Exception as err:
# print(err)
pass
def mai... |
leader.py | import logging
import threading
import time
from typing import Any
from typing import Callable
from kazoo.client import KazooClient
from kazoo.client import KazooState
from kazoo.exceptions import ConnectionClosedError
from kazoo.recipe.election import Election
from paasta_tools.deployd.common import PaastaThread
c... |
server.py | #!/usr/bin/env python3
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COP... |
TFLite_detection_webcam.py | ######## Webcam Object Detection Using Tensorflow-trained Classifier #########
#
# Author: Evan Juras
# Date: 10/27/19
# Description:
# This program uses a TensorFlow Lite model to perform object detection on a live webcam
# feed. It draws boxes and scores around the objects of interest in each frame from the
# webcam... |
recorder_pi.py | from threading import Thread
from picamera import PiCamera
import os, datetime, threading, subprocess, boto3, multiprocessing, time, os
from time import sleep
import RPi.GPIO as GPIO
def subprocess_cmd(command):
process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
proc_stdout = process.communicate... |
serial.py | """RAK811 serial communication layer.
Copyright 2019 Philippe Vanhaesendonck
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... |
server.py | '''
Create a server that 1)can only serve at most one person at the same time 2)print the message from the client 3)send back a "thank you" message
!!Important: only the child thread can close the client_socket! Main thread cannot close client_socket
1. create a socket
2. enable the socket to bind a sam... |
client.py | # Copyright (c) 2012-2014 Roger Light <roger@atchoo.org>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
... |
test_cpp_tcp_client.py | import multiprocessing as mp
from pathlib import Path
import subprocess
from unittest.mock import MagicMock
from libmuscle.mcp.tcp_server import TcpServer
from libmuscle.mcp.message import Message
from ymmsl import Reference, Settings
from .conftest import skip_if_python_only
def tcp_server_process(control_pipe):
... |
FakeAPI.py | """ fake api to return fake data """
import os
import time
import datetime
import uuid
import requests
import operator
import time
# import threading
from threading import Thread
from functools import reduce
from api.Mongo import DbOpsFactory
import api.Mongo.config_mapping as MAPPING
from scripts.__V2.sqlgraph_v2.cre... |
event_checker.py | import logging
import threading
import time
from datetime import datetime, timedelta
from sqlalchemy import column, func, select
from sqlalchemy.orm import SessionTransaction
from actions.discord import Discord
from actions.telegram import Telegram
from common.database import session
from common.models import Event, ... |
defs.py | """Strong typed schema definition."""
import http.server
import random
import socketserver
import string
from base64 import b64encode
from enum import Enum
from pathlib import Path
from threading import Thread
from time import time
from typing import Any, Dict, List, Optional, Union
from urllib.parse import parse_qs, u... |
device_server.py | #!/usr/bin/env python3
# Copyright 2020 Mathew Young
# 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 ... |
datagen.py | from faker import Faker
import avro.schema
from avro.datafile import DataFileReader, DataFileWriter
from avro.io import DatumReader, DatumWriter
import csv
import multiprocessing
from multiprocessing import Process
import uuid
import math
import os
import sys
data_dir = '.'
#total records number
records = 100
#leave... |
benchmark_aiorpc.py | """fork by https://github.com/choleraehyq/aiorpc/blob/master/benchmarks/benchmark_aiorpc_inet.py"""
import asyncio
import multiprocessing
import time
import aiorpc
import uvloop
from aiorpc import server
from aiorpc.constants import MSGPACKRPC_REQUEST
from aiorpc.exceptions import MethodNotFoundError, RPCProtocolError... |
equalizer.py | import multiprocessing as mp
import os
import signal
from collections import Counter, namedtuple
from time import time
from enum import Enum
import logging
_logger = logging.getLogger(__name__)
"""
Equal - The recorded and playback compared outputs are considered equal
Fixed - The playba... |
usage_statistics.py | import atexit
import datetime
import json
import logging
import platform
import signal
import sys
import threading
from functools import wraps
from queue import Queue
import jsonschema
import requests
from great_expectations import __version__ as ge_version
from great_expectations.core import nested_update
from great... |
Harmonbot.pyw | #! /usr/bin/env python3.9
import atexit
from queue import Queue
from subprocess import CREATE_NO_WINDOW, Popen, PIPE
import sys
from threading import Thread
from tkinter import BOTH, BooleanVar, Checkbutton, END, Frame, NONE, Text, Tk, ttk
from tkinter.font import Font
import psutil
class HarmonbotGUI:
def __init... |
__init__.py | # Copyright 2017 Mycroft AI 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 writin... |
aff4_test.py | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for the flow."""
import itertools
import os
import threading
import time
import mock
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import... |
tb_gateway_service.py | # Copyright 2022. ThingsBoard
#
# 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 ... |
midi_hub.py | """A module for interfacing with the MIDI environment."""
import abc
from collections import defaultdict
from collections import deque
import re
import threading
import time
import mido
from six.moves import queue as Queue
import tensorflow as tf
# TODO(adarob): Use flattened imports.
from magenta.common import conc... |
ui_utils.py | # -*- coding: utf-8 -*-
import collections
import logging
import os
import platform
import re
import shutil
import signal
import subprocess
import textwrap
import threading
import time
import tkinter as tk
import tkinter.font
import traceback
from tkinter import filedialog, messagebox, ttk
from typing import Callable, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.