source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
adb.py | import os
import time
from threading import Thread
from pyadb import Device, PyADB
from pyandroidtouch import common
from pyandroidtouch.py import PyAndroidTouch
class PyAndroidTouchADB(PyAndroidTouch):
PATH_REMOTE = '/data/local/tmp/android_touch'
def __init__(self, device: Device, *args, **kwargs):
... |
test_requests.py | from nose.tools import raises
from apmserver import ServerBaseTest, SecureServerBaseTest, ClientSideBaseTest, CorsBaseTest
from requests.exceptions import SSLError
import requests
import json
import zlib
import gzip
import time
from datetime import datetime
from collections import defaultdict
import threading
try:
... |
runner.py | import json
import subprocess
import sys
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x
from events import EventSource
from model import TestMethod
import pipes
def enqueue_output(out, queue):
"""A utility method for cons... |
util.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Various low-level utilities.
"""
import datetime
import json
import math
import os
import re
import select
import signal
import subprocess
import sys
import time
import errno
import threading
import shutil
import stat
import shlex
import operator
im... |
usb_camera_client.py | # coding: utf-8
import Queue
import time
import threading
import cv2
QUEUE_SIZE = 10
TIME_INTERVAL_TAKE_PHOTO = 0.03 # camera is 30 FPS
class CameraClient():
def __init__(self, camNo = 0):
cap = cv2.VideoCapture(camNo)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
cap.set(cv2.CAP_PROP_FRAME_HEI... |
smtclient.py | # Copyright 2017,2020 IBM Corp.
#
# 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 agr... |
dbgserver.py | #!/usr/bin/env python2
#
# Copyright (c) 2017 ChipCraft Sp. z o.o.
#
# GDB compatible Debug Server for CC Processor
#
# Author: Rafal Harabien
#
# $Date: 2020-04-14 16:02:50 +0200 (wto, 14 kwi 2020) $
# $Revision: 547 $
#
import time, sys, os, stat, select, threading, logging, re, struct, binascii, socket, serial, ge... |
__init__.py | import threading
import time
from functools import wraps
from trashguy import TrashGuy
class Anim:
def __init__(self, text: str = 'Loading', speed: int = 0.2):
self.text: str = text
self.speed: int = speed
self.thread: threading.Thread = threading.Thread()
self.trash_anim: TrashG... |
claim.py | import ast
import json
import logging
import os
import random
import sys
import time
import requests
from steamapi import SteamCommunity
from threading import Thread
from functools import wraps
def run_async(func):
@wraps(func)
def async_func(*args, **kwargs):
func_hl = Thread(target = func, arg... |
utils.py | # Copyright 2012-present MongoDB, 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 wri... |
myAQIGUI.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Jun 17 2015)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
unlogger.py | #!/usr/bin/env python
import argparse
import os
import sys
import zmq
import time
import gc
import signal
from threading import Thread
import numpy as np
from uuid import uuid4
from collections import namedtuple
from collections import deque
from multiprocessing import Process, TimeoutError
from datetime import datetim... |
executor.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... |
TWCManager.py | #! /usr/bin/python3
################################################################################
# Code and TWC protocol reverse engineering by Chris Dragon.
#
# Additional logs and hints provided by Teslamotorsclub.com users:
# TheNoOne, IanAmber, and twc.
# Thank you!
#
# For support and information, please re... |
spectrometer_task.py | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... |
clock.py | # SPDX-License-Identifier: MIT
# Copyright (c) 2022 The Pybricks Authors
import random
import signal
import threading
import time
class VirtualClock:
nanoseconds: int = 0
"""
The current clock time in nanoseconds.
This value is read when ``pbdrv_clock_get_ms()`` or ``pbdrv_clock_get_us``
is call... |
app.py | import json
import re
import threading
import time
import logging
from argparse import ArgumentParser
from collections import deque
from http import HTTPStatus
from http.server import HTTPServer, BaseHTTPRequestHandler
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
ADDRESS = '0.0.0.0'
PO... |
pipeline_ops_test.py | # Copyright 2020 Google LLC. 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 a... |
utils.py | import sublime
import os
import sys
import platform
import subprocess
import threading
import socket
import traceback
import fnmatch
DEBUG = True
DEBUG = False
PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__))
RUN_PATH = os.path.join(PACKAGE_PATH, 'backend_run.js')
if DEBUG: RUN_PATH = os.path.join(PACKAGE_PA... |
cli.py | import logging
import os
import threading
import webbrowser
from typing import Any, Dict, List
import toml
import typer
import uvicorn
from fps_uvicorn.config import UvicornConfig
from fps.config import Config
from fps.logging import configure_loggers, get_loggers_config
from fps.utils import merge_dicts
app = typer... |
thread_names.py | from threading import Thread, current_thread
import time
import prctl
def sleeper():
prctl.prctl(prctl.NAME, current_thread().name)
while True:
time.sleep(10)
print "sleeping"
threads = [Thread(target=sleeper, name="Sleeper01"),
Thread(target=sleeper, name="Sleeper02"),
T... |
server_socket.py | # -*- coding: utf-8 -*-
import socket
import ssl
import threading
import atexit
class Cli:
count = 0
def __init__(self, con_s, addr):
Cli.count += 1
print("New connection:",addr[0],addr[1],"In total",Cli.count,"connections")
self.con_s = con_s
self.addr = addr
self.topic... |
event_dispatcher.py | # Copyright 2019-2021 Wingify Software Pvt. Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
restcomm-test.py | #! /usr/bin/env python
# Load testing Restcomm Media Server
#
# Example invocations:
# - Secure invocation:
# $ ./restcomm-test.py --client-count 50 --client-url https://192.168.2.3:10510/webrtc-client.html --client-register-ws-url wss://192.168.2.3:5083 --client-register-domain 192.168.2.3 --client-username-prefix us... |
script.py | import io,os,sys,time,threading,ctypes,inspect,traceback
def _async_raise(tid, exctype):
tid = ctypes.c_long(tid)
if not inspect.isclass(exctype):
exctype = type(exctype)
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype))
if res == 0:
raise ValueError("inva... |
default.py | from multiprocessing import Process
from default_methods import *
from default_server import *
from default_sound import *
if __name__ == "__main__":
server_thread = Process(target=start_server)
server_thread.start()
while input('Exit [yes/no]: ') != 'yes': continue
server_thread.join()
# vim: tabstop=3 noexpa... |
brokenimebot.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Broken IME bot - Imitate recently broken Telegram iOS IME support
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 Pub... |
test_callbacks.py | import os
import multiprocessing
import numpy as np
import pytest
from csv import reader
from csv import Sniffer
import shutil
from keras import optimizers
from keras import initializers
from keras import callbacks
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Dropout, add
from kera... |
loader.py | from __future__ import print_function
import sys
import mxnet as mx
import numpy as np
import random
import datetime
import multiprocessing
import cv2
from mxnet.executor_manager import _split_input_slice
from rcnn.config import config
from rcnn.io.image import tensor_vstack
from rcnn.io.rpn import get_rpn_testbatch, ... |
lyr_blink.py | #!/usr/bin/python
import pxlBuffer as pxb
import random
from time import sleep
import time
def blinkColor(q, led_count, layerNum, wait_ms=1, color="random", runtime=30):
layer = pxb.pixelLayer(q, led_count, layerNum)
if color == "random":
rnd = True
else:
rnd = False
endTime=time.time()+runtime
while time.... |
ExampleServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
s3.py | """
Object Store plugin for the Amazon Simple Storage Service (S3)
"""
import logging
import multiprocessing
import os
import shutil
import subprocess
import threading
import time
from datetime import datetime
try:
# Imports are done this way to allow objectstore code to be used outside of Galaxy.
import boto
... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
testing_utils.py | """
weasyprint.tests.testing_utils
------------------------------
Helpers for tests.
:copyright: Copyright 2011-2019 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import contextlib
import functools
import logging
import os.path
import sys
import threading... |
test_sys.py | import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.support imp... |
workerpool.py | """Worker pool module."""
import logging
from threading import Thread, Event
import queue
_LOGGER = logging.getLogger(__name__)
class WorkerPool(object):
"""Worker pool class to implement single producer/multiple consumer."""
def __init__(self, worker_count, worker_func):
"""
Class constru... |
darkmode.py | # JustinTheWhale
"""
Program that converts all of the .pdf files
in the same directory to have a "Dark mode"
to put less strain on your eyes :-)
Final file will be saved with the same name
but with "_darkmode.pdf" at the end
Things to note:
Might take a while depending on how large your .pdf(s) is/are
Th... |
onnxruntime_test_python.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: UTF-8 -*-
import unittest
import os
import numpy as np
import onnxruntime as onnxrt
import threading
class TestInferenceSession(unittest.TestCase):
def get_name(self, name):
if os.path.exists(name... |
test_operator_gpu.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
run.py | """
This is the main script that starts everything.
"""
from multiprocessing import Process
import time
import uvicorn
from modules.worker.main import Worker
from settings import DATASTORE_APP_ADDRESS
def run_worker_app_process():
"""
start the worker application as a process
"""
worker_app_proc = Pr... |
index.py | from load_dataset import load_dataset
from params import get_params, get_possible_configurations
import traceback, os
import tux
from threading import Thread,BoundedSemaphore
params, hyperparams_list = get_params()
configs = get_possible_configurations(hyperparams_list)
df = load_dataset(params["nb_yes"])
params... |
core.py | """Ouster sensor Python client.
This module contains more idiomatic wrappers around the lower-level module
generated using pybind11.
"""
from contextlib import closing
from more_itertools import take
from typing import cast, Iterable, Iterator, List, Optional, Tuple
from typing_extensions import Protocol
from threadin... |
manager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import vim
import os
import sys
import time
import operator
import itertools
import threading
import multiprocessing
from functools import partial
from functools import wraps
from .instance import LfInstance
from .cli import LfCli
from .utils import *
from .fuzzyMatch impo... |
restservice.py | from fedn.clients.reducer.interfaces import CombinerInterface
from fedn.clients.reducer.state import ReducerState, ReducerStateToString
from flask_wtf.csrf import CSRFProtect
from werkzeug.utils import secure_filename
from flask import Flask, jsonify, render_template, request
from flask import redirect, url_for, flash... |
main.py | import threading
from time import sleep, time
from math import radians, degrees, atan2, sin, cos, sqrt
import serial
from flask import Flask, request
from flask_restful import Api, Resource, reqparse
import pigpio
from BlindBot.driver import Omni3Wheel
from BlindBot.gps import GPS
from BlindBot.sonar import Sonar
from... |
helper.py | """
Copyright 2018 EPAM Systems, 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... |
__init__.py | import logging
from typing import NoReturn, Optional
from simple_di import skip, sync_container
from ..configuration.containers import BentoMLContainer
logger = logging.getLogger(__name__)
# TODO:
def serve(
bundle_path_or_tag: str,
port: Optional[int] = None,
max_batch_size: Optional[int] = None,
... |
lichess-bot.py | import argparse
import chess
from chess.variant import find_variant
import chess.polyglot
import engine_wrapper
import model
import json
import lichess
import logging
import multiprocessing
import traceback
import logging_pool
import signal
import sys
import time
import backoff
from config import load_config
from conve... |
global_lib.py | import rollbar
import pprint
import yaml
import os, os.path
import sys
import time
import signal
from shutil import copy
from distutils.sysconfig import get_python_lib
from tabulate import tabulate
from pg_chameleon import pg_engine, mysql_source, pgsql_source
import logging
from logging.handlers import TimedRotatingF... |
test_pooled_db.py | """Test the PooledDB module.
Note:
We don't test performance here, so the test does not predicate
whether PooledDB actually will help in improving performance or not.
We also assume that the underlying SteadyDB connections are tested.
Copyright and credit info:
* This test was contributed by Christoph Zwerschke
"""
... |
cmd_helper.py | # Copyright (c) 2012 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.
"""A wrapper for subprocess to make calling shell commands easier."""
import logging
import os
import pipes
import select
import signal
import string
im... |
parallel.py | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/03a_parallel.ipynb (unless otherwise specified).
__all__ = ['threaded', 'startthread', 'set_num_threads', 'check_parallel_num', 'ThreadPoolExecutor',
'ProcessPoolExecutor', 'parallel', 'run_procs', 'parallel_gen']
# Cell
from .imports import *
from .foundatio... |
run.py | import tkinter as tk
from tkinter import *
import cv2, os
# import mysql.connector
import shutil
import csv
import numpy as np
from PIL import Image, ImageTk
import pandas as pd
import datetime
import time
import tkinter.ttk as ttk
import tkinter.font as font
from tensorflow.keras.applications.mobilenet_v2... |
core.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
#... |
crsf_drv.py | from dataclasses import dataclass
from threading import Lock, Thread
from typing import List
from construct import Container
from time import sleep, time
from sensor_msgs.msg import Joy
from .joy_publisher import JoyPublisher
from serial import Serial
from crsf_parser import CRSFParser, PacketsTypes, PacketValidationSt... |
__init__.py | """MAC address Monitoring daemon."""
import logging
import logging.handlers
import threading
import signal
import ipaddress
import daemon
import click
import netifaces
import scapy.all
CONFIG = {}
ADDRESSES = []
WORKERS = []
SHUTDOWN = threading.Event()
logging.basicConfig(format='[%(levelname)-8s] %(message)s')
... |
rpi_main.py | #!/usr/bin/env python3
# Receive car control + Transmit video
import cv2, imutils, socket, base64
from threading import Thread
from communication import SerialTransceiver
from utils import rescale
import time
tcp_server_address = ("192.168.0.119", 10001)
udp_server_address = ("192.168.0.119", 10002)
# tcp_server_addre... |
scanner.py | #!/usr/bin/env python3
import re
import sys
import requests
from time import sleep
from shodan import Shodan
from datetime import datetime
from threading import Thread, activeCount
# Shodan API Key (change according to your Shodan API key)
api_key = ''
# Shodan search query
search_query = 'http.title:"BIG-IP®- Red... |
runner.py | from __future__ import print_function
__true_print = print # noqa
import argparse
import datetime
import docker
import json
import multiprocessing
import numpy
import os
import psutil
import requests
import sys
import threading
import time
def print(*args, **kwargs): # noqa
__true_print(*args, **kwargs)
sy... |
50-save_log.py | import os
import sys
import shutil
import inspect
import time
import subprocess
import threading
from datetime import datetime
BlueskyMagics.positioners = motor_txm + motor_optics + motor_pzt + motor_lakeshore
class Auto_Log_Save(object):
"""
Auto save the motor position into logfile (/NSLS2/xf18id1/DATA/Mot... |
object_detection_multithreading.py | import os
import cv2
import time
import argparse
import numpy as np
import tensorflow as tf
import zmq
from queue import Queue
from threading import Thread
from multiprocessing import Process, Queue, Pool
from utils.app_utils import FPS, WebcamVideoStream, draw_boxes_and_labels
from object_detection.utils import label... |
thread_returnvalue.py | from threading import Thread
import time
class WorkerThread(Thread):
def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None):
Thread.__init__(self, group, target, name, args, kwargs, daemon=daemon)
self._return = None
def run(self):
self._return =... |
test_server.py | """Tests for the HTTP server."""
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from contextlib import closing
import os
import socket
import tempfile
import threading
import uuid
import pytest
import requests
import reque... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
test_signal.py | import errno
import os
import random
import signal
import socket
import statistics
import subprocess
import sys
import threading
import time
import unittest
from test import support
from test.support.script_helper import assert_python_ok, spawn_python
try:
import _testcapi
except ImportError:
_testcapi = None
... |
httpserver.py | # Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import json
import logging
import threading
from six.moves import BaseHTTPServer
from six.moves import http_client
_STOP_EVENT = '/fakeserver/__... |
unzip.py | #!/usr/bin/env python
import zipfile, optparse
from threading import Thread
def banner():
print "[***] Unzipper p29 [***]"
print ""
def extractFile(zFile, password):
try:
zFile.extractall(pwd=password)
print "[+] Found password"+password+"\n"
except:
pass
def main():
banner()
parser = optparse.OptionPars... |
test_double_spend.py | # Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
# # Double Spend testing
# This test challenge the system with double spends.
import os
from uuid import uuid4
from threading import Thread
import queue
import big... |
common.py | import inspect
import json
import os
import random
import subprocess
import ssl
import time
import requests
import ast
import paramiko
import rancher
import pytest
from urllib.parse import urlparse
from rancher import ApiError
from lib.aws import AmazonWebServices
from copy import deepcopy
from threading import Lock
fr... |
WaagentLib.py | #!/usr/bin/env python
#
# Azure Linux Agent
#
# Copyright 2015 Microsoft 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
#
# Unl... |
backend.py | #
# Copyright (c) 2021, NVIDIA 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 by applicable law or agreed ... |
idf_monitor.py | #!/usr/bin/env python
#
# esp-idf serial output monitor tool. Does some helpful things:
# - Looks up hex addresses in ELF file with addr2line
# - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R)
# - Run "make flash" (Ctrl-T Ctrl-F)
# - Run "make app-flash" (Ctrl-T Ctrl-A)
# - If gdbstub output is detected, gdb is automa... |
test_telemetry.py | #!/usr/bin/env python
# Python
import os
import sys
import yaml
import time
import signal
import unittest
from shutil import rmtree
from tempfile import mkdtemp
from multiprocessing import Process
from collections import OrderedDict
from unittest.mock import Mock, patch, call, PropertyMock
# ATS
from pyats.topology i... |
test_executor.py | from __future__ import division
from operator import add, sub
from collections import Iterator
from concurrent.futures import CancelledError
from datetime import timedelta
import itertools
from multiprocessing import Process
import os
import shutil
import sys
from threading import Thread
from time import sleep, time
i... |
main.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
@file: main.py
@author: kessil
@contact: https://github.com/kessil/
@time: 2019年06月02日 15:58:23
@desc: Life is short, you need Python
'''
from time import sleep
from adble import pull_xml, tap_screen
from model import Base, engine, Session,Bank, db_add, db_qeury
import r... |
keyboard-pygame.py | import pygame
from pygame.locals import *
import cv2 # pip3 install opencv-python
import os
import threading
import json
from common import *
import argparse
s_socket = ServerSocket()
white = (255, 255, 255)
black = (0, 0, 0)
blue = (0, 0, 128)
red = (200, 0, 0)
class CommandHandler:
def __init__(self):
... |
utils.py | import asyncio
from asyncio import TimeoutError
import atexit
import click
from collections import deque, OrderedDict, UserDict
from concurrent.futures import ThreadPoolExecutor, CancelledError # noqa: F401
from contextlib import contextmanager, suppress
import functools
from hashlib import md5
import html
import json... |
tcp_media.py | # encoding:utf-8
from .media import Media,MediaText
import socket
from queue import Queue
from threading import Thread
from tools.converter import str2bytearray
from PyQt5.QtCore import QTimer, pyqtSignal
def receive_from_socket(tcp_media):
while tcp_media.receiving:
data = tcp_media.socket.recv(1)
... |
main.py | # Fortnite-Api-Discord github.com/BayGamerYT/Fortnite-Api-Discord | Coding UTF-8
print('Fortnite-Api-Discord | Made by BayGamerYT')
import json, os
def data():
with open('config.json', 'r', encoding='utf-8') as f:
return json.load(f)
def text():
try:
with open(f'lang/{data()["bot_l... |
packeter_single_large_throttled.py | #!/usr/bin/env python
"""
Send a single large packet over a single connection.
@author: David Siroky (siroky@dasir.cz)
@license: MIT License (see LICENSE.txt or
U{http://www.opensource.org/licenses/mit-license.php})
"""
import time
import logging
import sys
from multiprocessing import Process
sys.path.ins... |
fake_server_manager.py | __author__ = 'dev'
import threading
class FakeServerManager:
def __init__(self, server_class, request_handler_class, server_port, **kwargs):
self.server = server_class(('', server_port), request_handler_class, kwargs)
def start_server(self):
threading.Thread(target=self.server.serve_forever)... |
api_unit_test.py | import math
import os
import sys
import threading
import time
import unittest
filename = os.path.dirname(__file__)
gdsName = os.path.join(filename, "../../../../src")
fprimeName = os.path.join(filename, "../../../../../Fw/Python/src")
sys.path.insert(0, gdsName)
sys.path.insert(0, fprimeName)
from fprime_gds.common.t... |
threading_server_forever.py | """
Multi-threaded Version Hello World Web Server
"""
import socket
import threading
def process_connection(client):
"""处理客户端连接"""
# 接收客户端发来的数据
data = b''
while True:
chunk = client.recv(1024)
data += chunk
if len(chunk) < 1024:
break
# 打印从客户端接收的数据
print(f'... |
main.py | import subprocess
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QMainWindow, QDesktopWidget
import sys
import easygui
global script
global stop
# Preferences
clearConsoleOnScriptChanged = True
class AppWindow(QMainWindow):
def __init__(self):
super(AppWindow, sel... |
hotspot-game.py | #!/usr/bin/env python
"""
hotspot-game ver 0.8 written by Claude Pageau pageauc@gmail.com
Raspberry (Pi) - python opencv2 motion tracking using picamera module
This is a raspberry pi python opencv2 motion tracking demonstration game.
It will detect motion in the field of view and return x and y coordinates
of the mos... |
hitbtc.py | #import Built-Ins
import logging
from threading import Thread
from queue import Queue, Empty
import json
import time
import hmac
import hashlib
# Import Third-Party
from websocket import create_connection, WebSocketTimeoutException
# Import Homebrew
from .base import WSSAPI
# Init Logging Facilities
log = logging.get... |
es_index_listener.py | """\
Example.
%(prog)s production.ini
"""
from webtest import TestApp
from snovault import STORAGE
from snovault.elasticsearch import ELASTIC_SEARCH
import atexit
import datetime
import elasticsearch.exceptions
import json
import logging
import os
import psycopg2
import select
import signal
import socket
import ... |
clockmanager.py | import alarmclock.clock as AlarmClock
import sys
import getopt
import unittest
import clockconfig
import utils.log as log
import multiprocessing
from multiprocessing import Queue
from threading import Timer
from gui import app
import messages
def execute_system_test(logger):
"""
Execute the system test
""... |
streaming.py | # Tweepy
# Copyright 2009-2020 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import
import json
import logging
import re
import requests
import ssl
import sys
from threading import... |
dump.py | #!/usr/bin/python3
# coding=utf-8
#######################################################
# File : dump.py #
# Author : Rizal F #
# Github : https://github.com/Rizal-XD #
# Facebook : https://www.facebook.com/AKUN.KERTASS... |
viewer_3d.py | #-------------------------
#3d Renderer
#Daniel Miron
#7/5/2013
#
#Allows 3d viewing of nerve cord or neuron stacks.
#Includes ability to fully rotate image in 3 dimensions and to mark locations in 3-space
#
#Version Date: 7/26 10:30
#-------------------------
import sys
sys.path.append('.')
import h5py
import numpy a... |
job_engine.py | # -*- coding: utf-8 -*-
"""
Accepts and handles requests for tasks.
Each of the following runs in its own Thread/Process.
BASICALLY DO A CLIENT/SERVER TO SPAWN PROCESSES
AND THEN A PUBLISH SUBSCRIBE TO RETURN DATA
Accepter:
Receives tasks and requests
Delegates tasks and responds to requests
Tasks are de... |
scdlbot.py | # -*- coding: utf-8 -*-
"""Main module."""
import gc
import pathlib
import random
import shelve
import shutil
from datetime import datetime
from multiprocessing import Process, Queue
from queue import Empty
from subprocess import PIPE, TimeoutExpired # skipcq: BAN-B404
from urllib.parse import urljoin, urlparse
from... |
server.py | import datetime
import json
import os
import requests
import random
import threading
import logging
from flask import Flask
from flask import request
from pymongo import MongoClient
from routing import configuration
from routing import graph
from routing import osm_handler
from routing.utils import bring_closer
mongo_... |
test_wrapper.py | __copyright__ = "Copyright (C) 2009 Andreas Kloeckner"
__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 use, copy, ... |
test_multi_processing_approach.py | # class approach for dynamic plotting
import multiprocessing
import test_dynamic_plotting as plotter
import test_optmizing_BPM as BPM
import tests_rpm as RPM
BPM_proc = multiprocessing.Process(target = BPM.run_it)
plotter_proc = multiprocessing.Process(target = plotter.run_it)
RPM_proc = multiprocessing.Process(target... |
util.py | # coding: utf-8
import sys
import json
import re
import os
import functools
import platform
import threading
try:
from bs4 import BeautifulSoup as bs
import requests as rq
from argparse import ArgumentParser
except:
err = """
You haven't installed the required dependencies.
Run 'python setup.py ... |
shadow.py | #!/usr/bin/env python
# 2020 March 1 - modified and adapted for robot by Tal G. Ball,
# Maintaining Apache License, Version 2 and Amazon's Copyright Notice
# Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not us... |
u2f.py | """
Copyright 2018-present SYNETIS.
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, softwar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.