source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_socket.py | import os
import sys
import threading
import socket
import time
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
import shadowysocket
class echoserver():
def __init__(self):
self.conn = socket.socket()
self.conn.bind(("127.0.0.1", 12300))
... |
gamequeue.py | import logging
import multiprocessing
import random
import motor.motor_tornado
from tornado import gen
from tornado import ioloop
from .runner import Runner
from .utils import create_token
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s')
logger = logging.getLogger(__name__)
logger.setLevel(logg... |
multiuser_db_assault.py | import prodigy
from multiprocessing import Process
from time import sleep
import atexit
from pathlib import Path
from prodigy.components import printers
from prodigy.components.loaders import get_stream
from prodigy.core import recipe, recipe_args
from prodigy.util import TASK_HASH_ATTR, log
from datetime import datet... |
queue.py | import time
from multiprocessing import Process
from threading import Timer
from .timecode import seconds_to_timecode
from .converter import MediaConverter
class MediaConverterQueue:
def __init__(self, log_directory='', max_processes=1, logging=False, debug=False):
self.job_list = []
self.proces... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence
from electrum.storage import WalletStorage, StorageReadWriteError
from electrum.wallet_db import WalletDB
from el... |
mock_web_server.py | import sys
from threading import Thread
import socket
import random
if (sys.version_info > (3, 0)):
from http.server import BaseHTTPRequestHandler, HTTPServer
else:
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
def get_free_port():
"""
Retrieves a free port for the mock service to use... |
test_socket_pair_pipeline.py | # -*- coding: utf-8 -*-
import multiprocessing
import pytest
from xTool.servers.pipeline import SocketPairPipeline
def _task(server_connector, message):
server_connector.close_other_side()
server_connector.send(message)
def _task_with_queue(queue, message):
queue.put(message)
class TestSocketPairPipe... |
test_local_task_job.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... |
test_data.py | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for coverage.data"""
import glob
import os
import os.path
import re
import sqlite3
import threading
from unittest import mock
import pytest
from coverag... |
function_exec_manager.py | #!/usr/bin/env python3
"""
Imagine you have to run multiple functions within a deadline.
Running them sequentially will be the easiest thing to do, but if one of them behaves badly
and takes too much time, we are in trouble...
This code, instead of runing functions sequentially, we run them all on separate threads in... |
fslock.py | # Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
#
# 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 appli... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_clients.py | # -*- coding: utf-8 -*-
# Copyright 2012-2021 CERN
#
# 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 os
import datetime
import yaml
import streamlit as st
from multiprocessing import Process
import psutil
import time
import pandas as pd
from typing import Callable, Union
def escape_markdown(text: str) -> str:
"""Helper function to escape markdown in text.
Args:
text (str): Input text.
Re... |
basic_gpu_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
no_perception.py | import threading
import time
from darcyai import DarcyAI
if __name__ == "__main__":
ai = DarcyAI(do_perception=False)
threading.Thread(target=ai.Start).start()
ai.LoadCustomModel('src/examples/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite')
while True:
time.sleep(1)
_, lat... |
test_kudu.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... |
monitor_utils.py | # -*- coding: utf-8 -*-
'''
(c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights
Reserved.
The copyright to the software program(s) is property of Telefonica I+D.
The program(s) may be used and or copied only with the express written
consent of Telefonica I+D or in accordance with the terms and co... |
test_pubsub.py | import platform
import threading
import time
from unittest import mock
from unittest.mock import patch
import pytest
import redis
from redis.exceptions import ConnectionError
from .conftest import _get_client, skip_if_redis_enterprise, skip_if_server_version_lt
def wait_for_message(pubsub, timeout=0.1, ignore_subs... |
main.pyw | import sys
import pathlib
import threading
from winpty import PtyProcess
from PySide2 import QtCore, QtWidgets, QtWebEngine, QtWebEngineWidgets, QtWebChannel, QtNetwork, QtWebSockets
_SCRIPT_DIR = pathlib.Path(__file__).resolve().parent
class TerminalAPI(QtCore.QObject):
def __init__(self, term=None):
s... |
build_environment.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module contains all routines related to setting up the package
build environment. All of this is set up by packa... |
scene.py | import _thread as thread
import ast
import io
import json
import os
import sqlite3
import sys
import time
import warnings
from multiprocessing import Process
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "."))
from shared import SharedOptions
if SharedOptions.PROFILE == "windows_native":... |
A3CtypeAD.py | '''
Type anomaly detection file
'''
# Based on Denny Britz A3C algorithm
import tensorflow as tf
import threading
import multiprocessing
import os
import shutil
import itertools
from my_enviroment import my_env
from estimators import ValueEstimator, PolicyEstimator
from policy_monitor import PolicyMonitor
from wo... |
run_callback_receiver.py | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import logging
import os
import signal
import time
from uuid import UUID
from multiprocessing import Process
from multiprocessing import Queue as MPQueue
from Queue import Empty as QueueEmpty
from Queue import Full as QueueFull
from kombu import Conne... |
perf-parallel.py | """num_threads simulates the number of clients
num_requests is the number of http requests per thread
num_metrics_per_request is the number of metrics per http request
Headers has the http header. You might want to set X-Auth-Token.
Urls can be an array of the Monasca API urls. There is only one url in
it right now, bu... |
test_connect.py | import pytest
import pdb
import threading
from multiprocessing import Process
from utils import *
CONNECT_TIMEOUT = 12
class TestConnect:
def local_ip(self, args):
'''
check if ip is localhost or not
'''
if not args["ip"] or args["ip"] == 'localhost' or args["ip"] == "127.0.0.1":... |
admin.py | # Copyright (c) 2021-2022, NVIDIA 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 required by ... |
test_transport.py | """Unit tests for the transport module."""
from datetime import datetime
import logging
import queue
import os
import platform
import select
import socket
import ssl
from struct import pack
import sys
import threading
import time
import pytest
from pydicom import dcmread
import pynetdicom
from pynetdicom import AE,... |
Arangers.py | # -*- coding: utf-8 -*-
"""
penyusun bb cetakan
--->>
Panggil Script pada folder paling atas
Case :
Menyusun BB buku untuk dicetak
susunan file sbb:
Nama Konsumen/ (Folder paling atas)
Buku 1/
1.jpg
... |
dataset.py | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""The :class:`StreamingDataset` class, used for building streaming iterable datasets.
"""
import math
import os
from io import BytesIO
from threading import Lock, Thread
from time import sleep
from typing import Any, Callable, Dict, Ite... |
main_3.py | from threading import Semaphore, Thread, Lock
from time import sleep
count = 5
io = Lock()
states = ['thinking'] * count
lock = Semaphore(1)
permission_signal = [Semaphore(0) for _ in range(count)]
def update_permissions(philosopher_id):
left_philosopher_id = (philosopher_id - 1) % 5
right_ph... |
multi_threading.py | import time, threading
# 新线程执行的代码:
def loop():
print('thread %s is running...' % threading.current_thread().name)
n = 0
while n < 5:
n = n + 1
print('thread %s >>> %s' % (threading.current_thread().name, n))
time.sleep(1)
print('thread %s ended.' % threading.current_thread().nam... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
pi_threads.py | import threading
import numpy as np
import math
data = []
def process_bunch(start, iterations, step):
data.append(np.prod(np.array(([((2*i)**2) / ((2*i-1)*(2*i+1)) for i in range(start, iterations+1, step)]))))
if __name__ == "__main__":
iterations = 10000000
processors = 4
threads = []
for i in ... |
simple_day_rythm_light.py | #! /usr/bin/env python
import threading
import rospy
import actionlib
from nextfood_tasks.msg import *
from datetime import datetime
def str_to_sec(time_str):
h, m, s = time_str.split(':')
return int(h) * 3600 + int(m) * 60 + int(s)
def pretty_print_sec(seconds):
m, s = divmod(seconds, 60)
h, m = divmod... |
exposition.py | from __future__ import unicode_literals
import base64
from contextlib import closing
import os
import socket
import sys
import threading
from wsgiref.simple_server import make_server, WSGIRequestHandler, WSGIServer
from .openmetrics import exposition as openmetrics
from .registry import REGISTRY
from .utils import fl... |
Pipe.py | from PyQt5 import QtCore, QtWidgets
from PyQt5.QtGui import *
from wired_module import *
# Generated By WiredQT for Python: by Rocky Nuarin, 2021 Phils
import sys
from subprocess import PIPE, Popen
from threading import Thread
from queue import Queue, Empty
class Handler(QtWidgets.QWidget,usercontrol):
#... |
access.py | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import code_for_CRM_operation as z
# In[2]:
z.create("arpit",30)
# In[3]:
z.create("abc",60,3600)
# In[4]:
z.read("arpit")
# In[5]:
z.read("abc")
# In[6]:
z.create("arpit",50)
#it returns an ERROR since the key_name already exists in the database
#... |
_app.py | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the L... |
ransom.py | # __Author__ __Lencof__
# ransom.py
import os
import socket
import requests
import threading
from pathlib import Path
from cryptography.fernet import Fernet
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
# files for encryption
file_extension = ('.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx',... |
app.py | import tkinter as tk
import os
from tkinter.filedialog import askdirectory
from pytube import YouTube
from moviepy.audio.io.AudioFileClip import AudioFileClip
from threading import Thread
from PIL import Image, ImageTk
# Global variables
background_color = '#fff'
file_size = 0
small_font = ('Calibri', 10)
global_font... |
release_process.py | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifi... |
util.py | #vim:set fileencoding=utf-8:
###########################################################################
# #
# Copyright 2020 INTERSEC SA #
# ... |
osa_online_reintegration.py | #!/usr/bin/python
"""
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
import random
import threading
from itertools import product
from test_utils_pool import TestPool
from write_host_file import write_host_file
from daos_racer_utils import DaosRacerCommand
... |
TCP_S.py | import socket
import threading
import time
import sys
IP = '127.0.0.1'
PORT = 5050
SER_ADDR = IP,PORT
BUFFSIZE = 1024
def server_socket():
try:
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sk.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sk.bind(SER_ADDR)
sk.list... |
gateway.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
PBOX.py | # PBOX - Python Toolbox
# github.com/smcclennon/PBOX
import os, traceback
from time import sleep
data = {
"meta": {
"name": "PBOX",
"ver": "0.3.0",
"id": "6",
"sentry": {
"share_ip": False, # Used to track unique cases of envountered errors
"import_success"... |
transaction_microservice.py | from multiprocessing import Process, Queue
import json
from flask import Flask, jsonify, request
# Data Layer
def _load_transactions() -> list:
try:
with open('transactions.json', 'r') as infile:
return json.load(infile)["transactions"]
except FileNotFoundError:
with open('transact... |
sphinx_multibuild.py | #!/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import errno
import logging
import os
import subprocess
import sys
import threading
import time
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
# buffers events until a specifie... |
base_camera.py | import time
import threading
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients when a new frame is
... |
st_experiments.py | import os
import sys
import inspect
import time
import json
import signal
import numpy as np
from pathlib import Path
from collections import OrderedDict
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import plotly.express as px
import configparser
import webbrowser
from io import BytesIO... |
coverage_test_proxy.py | from Queue import Queue
import random
import socket
import threading
import unittest
from coapclient import HelperClient
from coapforwardproxy import CoAPForwardProxy
from coapserver import CoAPServer
from coapthon import defines
from coapthon.messages.option import Option
from coapthon.messages.request import Request
... |
abcd.py | import logging
from abc import ABCMeta
from queue import Queue
from collections import defaultdict
from threading import Lock, Thread
import time
from ..types import DokyBase
import threading
global queue_lock
queue_lock = Lock()
class EventQueue(Queue, object):
def __init__(self, num_worker=10):
super(Ev... |
housekeeping.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import gtk
import glob
import os
import subprocess
import sys
import tempfile
import threading
import platform
import gobject
import re
import copy
import time
from datetime import datetime
import stat
try:
cwd = os.getcwd()
os.chdir(os.path.dirname(os.path.realpath(s... |
advanced-reboot.py | #
#ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";d... |
demo.py | # --------------------------------------------------------
# SiamMask
# Licensed under The MIT License
# Written by Qiang Wang (wangqiang2015 at ia.ac.cn)
# --------------------------------------------------------
from threading import Thread
from tools.test import *
parser = argparse.ArgumentParser(description='PyTo... |
Hiwin_RT605_Socket_v3_20190628113337.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd_v3 as TCP
import HiwinRA605_socket_Taskcmd_v3 as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.s... |
run-spec-test.py | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py ./core/i32.json
# ./run-spec-test.py ./core/float_exprs.json --line 2070
# ./run-spec-test.py ./proposals/tail-call/*.json
# ./run-spec-test.py --exec "../build-custom/wasm3 --repl"
#
# Running WASI veris... |
recipe-577360.py | import threading
def concurrent_map(func, data):
"""
Similar to the bultin function map(). But spawn a thread for each argument
and apply `func` concurrently.
Note: unlike map(), we cannot take an iterable argument. `data` should be an
indexable sequence.
"""
N = len(data)
result = [N... |
main.py | # original code at https://github.com/clear-code-projects/Snake
# original code at https://techwithtim.net/tutorials/socket-programming/
# modified by Hanchai Nonprasart
import pygame,random
from pygame.math import Vector2
import socket,threading,os
class SNAKE:
def __init__(self,i,d):
self.i=i
self.d=d
self.b... |
notes.py | #!/usr/bin/python3
# NOTE: May require the system Python 3 rather than using 3.9
import os.path
import sys
import json
import socket
import functools
import threading
import traceback
import subprocess
import time
import requests
import speech_recognition as sr
TRIGGER_SOCKET = "/tmp/stenographer"
NOTES_DIR = os.path.... |
simple_detector.py | import cv2
import numpy as np
import imutils
from imutils.video.webcamvideostream import WebcamVideoStream
import os, copy, time, datetime, json, threading
import boto3
try: import osenv
except: pass
if os.environ.get('DEMO') == '1':
print('Mode: DEMO')
import main
main.app.run(host='0.0.0.0', debug=False,... |
test_scheduler_disjoint.py | import unittest
from microbus.scheduler_disjoint import DisjointRoutesBusScheduler
from microbus.assignment import BusAssignment
import microbus
from microbus.bus import Bus
import time
import threading
class DisjointSchedulerTest(unittest.TestCase):
def setUp(self):
self.stop1 = microbus.BusStop("stop1")... |
python_bindings_example_server.py | #!/usr/bin/python3
# Build required code:
# $ ./examples/buildall.py
#
# Start zmqproxy (only one instance)
# $ ./build/zmqproxy
#
# Run server, default enabling ZMQ interface:
# $ LD_LIBRARY_PATH=build PYTHONPATH=build python3 examples/python_bindings_example_server.py
#
import os
import time
import sys
import threa... |
ConductorWorker.py | #
# Copyright 2017 Netflix, 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... |
AWSBucketDump.py | #!/usr/bin/env python
# AWSBucketDump is a tool to quickly enumerate AWS S3 buckets to look for loot.
# It's similar to a subdomain bruteforcer but is made specifically to S3
# buckets and also has some extra features that allow you to grep for
# delicous files as well as download interesting files if you're not
# afr... |
threading.py | import threading
import datetime
from queue import Queue
from random import randint
import re
import sys
import traceback
import inspect
from datetime import timedelta
import logging
from appdaemon import utils as utils
from appdaemon.appdaemon import AppDaemon
class Threading:
def __init__(self, ad: AppDaemon, ... |
callbacks_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
geometry.py |
from django.template import Engine, Context
from django.conf import settings
from datetime import datetime
import codecs
import json
import os
import math
import threading
XML_IMPORT_EXEC = r"\\hssieng\SNDataPrd\__oys\bin\SNImportXML\SNImportXML.exe"
_dir = r'\\hssieng\SNDataPrd\__xml'
_input_dir = os.path.join(_di... |
ws.py | #!/usr/bin/env python3
# coding=utf-8
# => Author: Abby Cin
# => Mail: abbytsing@gmail.com
# => Created Time: Sat 31 Mar 2018 12:45:38 PM CST
from .websocket import create_connection
import json
import time
import math
import random
import requests
import sys
import re
import qrcode
import matplotlib.pyplot as plt
imp... |
request_historical_data.py | # Copyright (C) 2021 LYNX B.V. All rights reserved.
# Import ibapi deps
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import *
from ibapi.common import BarData
import threading
from datetime import datetime
from datetime import timedelta
from time import sleep
import pandas a... |
create_multiple_shipments.py | import os
import time
from threading import Thread
import easypost
# Create multiple shipments quickly, save their ID's to a file
# Usage: EASYPOST_TEST_API_KEY=123... SHIPMENT_NUM=100 venv/bin/python create_multiple_shipments.py
API_KEY = os.getenv('EASYPOST_TEST_API_KEY')
SHIPMENT_NUM = int(os.getenv('SHIPMENT_NU... |
worker.py | """
Because access to /dev/mapper is restricted to root, administrator privileges are needed
to handle encrypted containers as block devices. The GUI will be run from a normal
user account while all calls to cryptsetup and mount will be executed from a separate
worker process with administrator privileges. Everything t... |
binaryClock.py | # -*- coding: utf-8 -*-
import datetime
import time
import os.path
import inspect
import math
import threading
from shutil import copyfile
from neopixel import Color, Adafruit_NeoPixel, ws
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
import pythonModules.b... |
test_io.py | from __future__ import division, absolute_import, print_function
import sys
import gzip
import os
import threading
from tempfile import mkstemp, NamedTemporaryFile
import time
import warnings
import gc
from io import BytesIO
from datetime import datetime
import numpy as np
import numpy.ma as ma
from numpy.lib._iotool... |
_validators.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
rpiv2.py | #!/usr/bin/env python
import traitlets
import threading
import atexit
import cv2
import time
import numpy as np
from traitlets.config.configurable import SingletonConfigurable
class Camera(SingletonConfigurable):
# fixed resolution of the Raspberry Pi v2 camera
RPI_V2_WIDTH = 3280
RPI_V2_HEIGHT = 2464
... |
main.py | # Date and time improts
import datetime
from datetime import datetime as dt
import time
import sys
from credentials import TOGGL_TOKEN
from toggl.TogglPy import Toggl
from pprint import pprint
import urllib
import subprocess
import threading
# Basic setup
toggl = Toggl()
toggl.setAPIKey(TOGGL_TOKEN)
offset = in... |
test_server.py | # -*- mode: python; coding: utf-8 -*-
# Copyright 2020 the .NET Foundation
# Licensed under the MIT License.
from __future__ import absolute_import, division, print_function
from argparse import Namespace
from http.server import HTTPServer
import pytest
import requests
from threading import Thread
from time import sl... |
plugin.py | import base64
import re
import threading
from binascii import hexlify, unhexlify
from functools import partial
from electrum_stratis.stratis import (bc_address_to_hash_160, xpub_from_pubkey,
public_key_to_bc_address, EncodeBase58Check,
TYPE_ADDRESS, ... |
acs_client.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
_thread_cache.py | from threading import Thread, Lock
import sys
import outcome
from itertools import count
# The "thread cache" is a simple unbounded thread pool, i.e., it automatically
# spawns as many threads as needed to handle all the requests its given. Its
# only purpose is to cache worker threads so that they don't have to be
# ... |
ban.py |
import modules.core.extract as extract
import modules.core.database as database
import telegram
import threading
try:
from config1 import *
except:
from config import *
import time
class ban_cls():
def __init__(self,update,context) -> None:
self.update = update
self.context = context
... |
wget.py | import _io
import re
import selectors
import shlex
import subprocess
import threading
import time
from typing import Optional
from .base import DownloadWrapper, DownloadState
__all__ = ['WgetWrapper']
class WgetWrapper(DownloadWrapper):
def __init__(self, *args, **kw):
super().__init__(*args, **kw)
... |
util.py | import asyncio
import re
import webbrowser
from contextlib import contextmanager
from pathlib import Path, PosixPath, PurePosixPath, WindowsPath
from textwrap import wrap
from threading import Event, Thread, Timer
from typing import Any, AsyncGenerator, Generator, Iterable, Optional, Union
import click
import click_sp... |
newcli.py | """
cli.py
Sample CLI Clubhouse Client
RTC: For voice communication
"""
import os
import sys
import threading
import configparser
import keyboard
from rich.table import Table
from rich.console import Console
from clubhouse.clubhouse import Clubhouse
# Set some global variables
try:
import agorartc
RTC = ago... |
cmd_deleteshare.py | import json
import os
import six
from threading import Thread
import uuid
from oslo_log import log as logging
from hpedockerplugin.cmd import cmd
from hpedockerplugin import exception
LOG = logging.getLogger(__name__)
class DeleteShareCmd(cmd.Cmd):
def __init__(self, file_mgr, share_info):
self._file_m... |
_ipython_utils.py | """Utilities for integrating with IPython
These functions should probably reside in Jupyter and IPython repositories,
after which we can import them instead of having our own definitions.
"""
from __future__ import print_function
import atexit
import os
try:
import queue
except ImportError:
# Python 2
im... |
keylogg_button.py | #!/usr/bin/python3
#coding: utf-8
import os
import keyboard
from multiprocessing import Process
def process_1():
while True:
recorded = keyboard.record(until='RETURN')
print(str(recorded))
p = Process(target=process_1)
p.start()
p.join() |
linmix.py | """ linmix -- A hierarchical Bayesian approach to linear regression with error in both X and Y.
"""
from __future__ import print_function
import numpy as np
import sys
from scipy.stats import multivariate_normal
import time
import math
def nearly_equal(a,b,sig_fig=5):
return ( a==b or
int(a*10**sig_f... |
EPICS_CA_serial_test.py | """This script is to test various implementations of the Python to EPICS interface.
It checks wether these are multi-thread safe. That means that a caput and caget
to the same process valiable succeeds both from the forground and from a background
thread.
EpicsCA: Matt Newille, U Chicago
epics: Matt Newille, U Chicago... |
server.py | import threading
import signal
import socket
from random import randint
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
port = randint(2000, 5000)
sock.bind(('127.0.0.1', port))
print ("***Use this port number '{}' to connect.***".format(port)... |
ardundzdf.py | # -*- coding: utf-8 -*-
# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
from __future__ import division # // -> int, / -> float
from __future__ import print_function # PYTHON2-Statement -> Funktion
from kodi_six import xbmc, xbmcaddon, xbmcplugin, xbmcg... |
opennebulaUtils.py | import functools
import logging
from logging import handlers
from multiprocessing import Process
import pyone
# Logging Parameters
logger = logging.getLogger(__name__)
file_handler = handlers.RotatingFileHandler("katana.log", maxBytes=10000, backupCount=5)
stream_handler = logging.StreamHandler()
formatter = logging.... |
test_exp.py | import argparse
import json
import os
from pathlib import Path
from threading import Thread
import numpy as np
import torch
import yaml
from tqdm import tqdm
from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import (
coco80_to_coco91_class,
check_data... |
writer.py | import io
import os
from threading import Thread
from . import tk, config
__all__ = ("Writer", 'WriteFrame', 'RWriter')
def Writer(gls, box):
root = tk.root
top = tk.Toplevel(root)
w, h = top.maxsize()
top.geometry(f'700x500+{w // 6}+{h // 6}')
top.resizable(0,0)
wf = WriteFrame(gls, top, bo... |
server.py | # [Basic EE Ex SW Project] Electronic Engineering Software Project 19-2(xix_ii)
# 0.0.0va, 19.08.21. First tested, last update 19.08.23.
# written by acoustikue(SukJoon Oh)
#
# ____ __ __ ____ __
# / __/_ __/ /____ / /__ ___ ___ / __ \/ /
# _\ \/ // / '_/ // / _ \/ _ \/ _ \ / /_... |
btcc.py | from befh.restful_api_socket import RESTfulApiSocket
from befh.exchanges.gateway import ExchangeGateway
from befh.market_data import L2Depth, Trade
from befh.util import Logger
from befh.instrument import Instrument
from befh.clients.sql_template import SqlClientTemplate
import time
import threading
from functools impo... |
engine.py | #!/usr/bin/env python3
# -*-coding: utf-8-*-
# Author : Christopher Lee
# License: MIT License
# File : engine.py
# Date : 2016-12-24 03:03
# Version: 0.0.3
# Description: the core engine of this crawler, which schedules the downloader to handle requests
# in the queue. Besides, it invokes corresponding parser of d... |
iconizer_app_root_v2.py | import os
import threading
import traceback
from Pyro4.errors import CommunicationError
from ufs_tools.short_decorator.ignore_exception import ignore_exc_with_result
from iconizer import Iconizer
from iconizer.iconizer_client import IconizerClient
# noinspection PyMethodMayBeStatic
class IconizerAppRootV2(object):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.