source
stringlengths
3
86
python
stringlengths
75
1.04M
test.py
# -*- coding: utf-8 -*- import redis import unittest from hotels import hotels import random import time def testAdd(env): if env.is_cluster(): raise unittest.SkipTest() r = env env.assertOk(r.execute_command( 'ft.create', 'idx', 'schema', 'title', 'text', 'body', 'text')) env.assert...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import tempfile import urllib.request import traceback import asyncore import weakref import platform import functools ssl =...
prepare_mcg_maskdb.py
# -------------------------------------------------------- # Multitask Network Cascade # Written by Haozhi Qi # Copyright (c) 2016, Haozhi Qi # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- # System modules import argparse import os import cPickle i...
test_gevent.py
import unittest import _yappi import yappi import gevent from gevent.event import Event import threading from .utils import ( YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io, burn_io_gevent ) class GeventTestThread(threading.Thread): def __init__(self, name, *args, **kwargs): super(GeventTe...
light_reaper.py
# -*- coding: utf-8 -*- # Copyright 2016-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...
test_tcp.py
""" :codeauthor: Thomas Jackson <jacksontj.89@gmail.com> """ import logging import socket import threading import salt.config import salt.exceptions import salt.ext.tornado.concurrent import salt.ext.tornado.gen import salt.ext.tornado.ioloop import salt.transport.client import salt.transport.server import salt.u...
_eventloop.py
""" Expose Twisted's event loop to threaded programs. """ from __future__ import absolute_import import select import threading import weakref import warnings from functools import wraps import imp from twisted.python import threadable from twisted.python.runtime import platform from twisted.python.failure import F...
env_wrappers_poet_sp.py
""" Modified from OpenAI Baselines code to work with multi-agent envs """ import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv, CloudpickleWrapper def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while Tru...
monte_carlo_tools.py
############################################################################## # Some functions to make Monte-Carlo simulations smoother # Authored by Ammar Mian, 29/10/2018 # e-mail: ammar.mian@centralesupelec.fr ############################################################################## # Copyright 2018 @CentraleS...
webcamvideostream.py
# import the necessary packages from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, src=0, name="WebcamVideoStream"): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src) (self.grabbed, self.frame) = self.stream.rea...
threading_lock.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # author: bigfoolliu """ ๅคš็บฟ็จ‹้€šไฟก ไฝฟๆต‹่ฏ•็ฑปๅž‹ๅ’Œ็”จ้” """ import threading from threading import Thread # ๅˆ›ๅปบ้” lock = threading.Lock() l = [] def no_lock_append_task(i): """ๆœชไฝฟ็”จ้”็š„ๆƒ…ๅ†ตไธ‹ๅ‘ๅ…จๅฑ€ๅ˜้‡ๅˆ—่กจlไธญๆทปๅŠ ๅ…ƒ็ด """ global l l.append(i) print("no lock l:", l) def lock_append_task...
test_jobs.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
baseline_racer.py
from argparse import ArgumentParser import airsimdroneracinglab as airsim import cv2 import threading import time import utils import numpy as np import math # drone_name should match the name in ~/Document/AirSim/settings.json class BaselineRacer(object): def __init__( self, drone_name="drone_1", ...
watcher.py
from __future__ import print_function import datetime import os import threading import time class Watcher(object): def __init__(self, files=None, cmds=None, verbose=False, clear=False): self.files = [] self.cmds = [] self.num_runs = 0 self.mtimes = {} self._monitor_continou...
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...
test_pool.py
import threading import pytest from milvus import Milvus, NotConnectError, VersionError from milvus.client.pool import ConnectionPool class TestPool: def test_pool_max_conn(self): pool = ConnectionPool(uri="tcp://127.0.0.1:19530", pool_size=10) def run(_pool): conn = _pool.fetch() ...
strd_test.py
import os,random,asyncio,traceback import uvloop asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) os.system("cd /root/b/d/d;mv *flv /root/b;cd /root/b/d/huya;mv *mp4 /root/b") import time import re import requests import threading import sys import json import toml from mail import send_mail tryy = i...
instruments.py
import time import threading from queue import Queue """Instrumentation for measuring high-level time spent on various tasks inside the runner. This is lower fidelity than an actual profile, but allows custom data to be considered, so that we can see the time spent in specific tests and test directories. Instrument...
runCDN.py
#!/usr/bin/env python3 import subprocess import sys import threading # list of all EC2 servers EC2_SERVERS = [ 'ec2-34-238-192-84.compute-1.amazonaws.com', # N. Virginia 'ec2-13-231-206-182.ap-northeast-1.compute.amazonaws.com', # Tokyo 'ec2-13-239-22-118.ap-southeast-2.compute.amazonaws....
workthread.py
# -*- coding: UTF-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in compliance with the License. You may ...
ConnectionProvider.py
# -*- coding: UTF-8 -*- import socket import threading import SystemHelpers class ConnectionProvider(object): def __init__(self, destination_ip = '', server_port=20001, client_port = 20002): self._destination_ip = destination_ip self._server_port = server_port self._client_port = client_p...
test_pool.py
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.testing import assert_raises from sqlalchemy.testing import assert_raises_message f...
tests.py
# -*- coding: utf-8 -*- import os import shutil import sys import tempfile import time from cStringIO import StringIO from datetime import datetime, timedelta from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.core.files.base import ContentFile, File from django.core.fil...
KISSInterface.py
from .Interface import Interface from time import sleep import sys import serial import threading import time import RNS class KISS(): FEND = 0xC0 FESC = 0xDB TFEND = 0xDC TFESC = 0xDD CMD_UNKNOWN = 0xFE CMD_DATA = 0x00 CMD_TX...
learn.py
#!/usr/bin/python3 import json import csv from random import shuffle import warnings import pickle import gzip import operator import time import logging import math from threading import Thread import functools import multiprocessing # create logger with 'spam_application' logger = logging.getLogger...
sentiment_analysis_server.py
import grpc from concurrent import futures import threading import logging # import the generated classes : import model_pb2 import model_pb2_grpc from app import app_run # import the function we made : import model as psp port = 8061 results = [] # create a class to define the server functions, derived from class ...
wss.py
# -*- coding: utf-8 -*- """ Created on Sat Mar 24 00:16:07 2020 @author: tranl """ import time, sys, math import numpy as np import pandas as pd import websocket import threading import json from tradingpy import PRICEPRE, SIDE, Signal from utility import print_, orderstr, timestr, barstr def wss_run(*args): de...
cornershot.py
import queue import threading import time from random import uniform,shuffle from .shots import PORT_UNKNOWN,PORT_FILTERED,PORT_OPEN from .shots.even import EVENShot from .shots.even6 import EVEN6Shot from .shots.rprn import RPRNShot from .shots.rrp import RRPShot from . import logger MAX_QUEUE_SIZE = 5000 TARGET_PO...
test_utilities.py
import threading from _pydevd_bundle.pydevd_utils import convert_dap_log_message_to_expression from tests_python.debug_constants import IS_PY26, IS_PY3K, TEST_GEVENT, IS_CPYTHON import sys from _pydevd_bundle.pydevd_constants import IS_WINDOWS, IS_PY2, IS_PYPY import pytest import os import codecs from _pydevd_bundle....
port-sniffer.py
import os import re import sys import time import socket import datetime import argparse import termcolor import threading import concurrent.futures parser = argparse.ArgumentParser( description="Check if hosts are up.", formatter_class=lambda prog: argparse.HelpFormatter( prog, max_help_position=150,...
test_utils.py
# -*- coding: utf-8 -*- import json import os import shutil import tempfile import time import zipfile import multiprocessing import contextlib from unittest import mock from django import forms from django.conf import settings from django.forms import ValidationError from django.test.utils import override_settings ...
send_telemetry_events.py
# Microsoft Azure Linux Agent # # Copyright 2020 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 # # Unless required b...
msg_sender.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013, 2014 Scalr 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 requi...
executor.py
"""LowLatencyExecutor for low latency task/lambda-function execution """ from concurrent.futures import Future import logging import threading import queue from multiprocessing import Process, Queue from ipyparallel.serialize import pack_apply_message # ,unpack_apply_message from ipyparallel.serialize import deseria...
collect_telemetry_events.py
# Microsoft Azure Linux Agent # # Copyright 2020 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 # # Unless required b...
Filterastic.py
# Libraries from Tkinter import * from PIL import Image from PIL import ImageTk import cv2, threading, os, time from threading import Thread previous=0 smile=0 def get_sprite(num): global SPRITES SPRITES[num] = (1 - SPRITES[num]) def smile_Detection(current): global previous global sm...
randoms.py
#!/usr/bin/env python # Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P. # # 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...
key_press.py
'''This module implements non-blocking methods waiting for specific key to be pressed. This thing is hard to do in Python without external libraries, so forgive me for any non-working hacks below. ''' def _windows_key_press(wanted_key, stop_event, received_cb): '''Check for key presses from stdin in non-blocking w...
celery_command.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_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import platform import array import contextlib from weakref import proxy import signal import math import pickle import struct impo...
test_asyncore.py
import asyncore import unittest import select import os import socket import threading import sys import time import errno from test import test_support from test.test_support import TESTFN, run_unittest, unlink from StringIO import StringIO HOST = test_support.HOST class dummysocket: def __init__(self): ...
solver.py
# -*- coding: utf-8 -*- """ Created on Wed Nov 20 11:09:46 2019 @author: azmanrafee """ def sweepbyangle(energy_group,X0, XN, omega_j, Q_mp, Sigma_trans, omega_azim, NN, delx, sintheta_j,j, group_mp, angles, phi_j_mp, a, b, phi_mpp, on, active): import math, numpy as np phi_j=np.zeros((energy_group...
display.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # OpneWinchPy : a library for controlling the Raspberry Pi's Winch # Copyright (c) 2020 Mickael Gaillard <mick.gaillard@gmail.com> from luma.core.render import canvas from luma.core.sprite_system import framerate_regulator from PIL import ImageFont from abc import ABC, ...
qtum_transaction_receipt_origin_contract_address.py
#!/usr/bin/env python3 from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import * from test_framework.mininode import * from test_framework.address import * import threading def waitforlogs(node, contract_address): logs = node.cli.waitforlo...
scheduler.py
import logging import os import signal import time import traceback from datetime import datetime from multiprocessing import Process from redis import Redis, SSLConnection, UnixDomainSocketConnection from .defaults import DEFAULT_LOGGING_DATE_FORMAT, DEFAULT_LOGGING_FORMAT from .job import Job from .logutils import ...
periodic_executor.py
# Copyright 2014-2015 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 ...
SERVER.py
import socket import threading import pyfiglet from pyfiglet import Figlet import os #clear screen os.system('cls' if os.name == 'nt' else 'clear') #aTAG LINE print('''\033[5;31;40m _____ _____ __| _ |__...
env_wrappers.py
""" Modified from OpenAI Baselines code to work with multi-agent envs """ import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv, CloudpickleWrapper def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while Tru...
sasiostdio.py
# # Copyright SAS Institute # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
server.py
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket import threading class _Client(WebSocket): def handleMessage(self): thr=threading.Thread(target=self.process_message,args=(),kwargs={}) thr.deamon=True thr.start() def handleConnected(self): self.WS.on_client_connect(self) def handleClose(...
zbot.py
#!/usr/bin/python3 from telebot import types import telebot from constraints import API_KEY, BITLY_ACCESS_TOKEN, ngrok_auth_token import threading from flask import Flask, render_template, request from datetime import datetime import base64 import os from pyngrok import ngrok import pyfiglet import loggin...
mpd_art_box.py
#!/usr/bin/env python import contextlib import os import pathlib import threading import time import configargparse import gi import mpd gi.require_version('Gtk', '3.0') from gi.repository import Gio, GLib, Gtk, Gdk, GdkPixbuf # noqa: E402 version = '0.0.8' @contextlib.contextmanager def _mpd_client(*args, **kwa...
cloudinit_callback.py
#!/usr/bin/env python # coding: utf-8 # Purpose: receives provisioned VMs info via cloud-init phone_home from __future__ import absolute_import import os try: import Queue except ImportError: import queue as Queue import random import string import sys import web from collections import OrderedDict from optp...
worker.py
# PyAlgoTrade # # Copyright 2011-2018 Gabriel Martin Becedillas Ruiz # # 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 ap...
engine.py
import json import copy import rules import threading import inspect import random import time import datetime import os import sys import traceback def _unix_now(): dt = datetime.datetime.now() epoch = datetime.datetime.utcfromtimestamp(0) delta = dt - epoch return delta.total_seconds() class Closur...
absentis.py
import os.path from burp import IBurpExtender, IIntruderPayloadGeneratorFactory, IIntruderPayloadGenerator, IScannerCheck, IScanIssue, IScannerInsertionPointProvider, IContextMenuFactory, IContextMenuInvocation, IScannerInsertionPoint, IScanIssue, IExtensionStateListener import json from java.io import PrintWriter fro...
line_detector_node_yellow_blue.py
#!/usr/bin/env python from anti_instagram.AntiInstagram import * from cv_bridge import CvBridge, CvBridgeError from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment, SegmentList, Vector2D) from duckietown_utils.instantiate_utils import instantiate from duckietown_utils.jpg import image_cv_fr...
jarm.py
# Version 1.0 (November 2020) # # Created by: # John Althouse # Andrew Smart # RJ Nunaly # Mike Brady # # Converted to Python by: # Caleb Yu # # Added multiprocessing by: # Leo M. Falcon (https://github.com/A3sal0n) # # Copyright (c) 2020, salesforce.com, inc. # All rights reserved. # Licensed under the BSD 3-Clause l...
run_consensus.py
import argparse import asyncio import threading import sys import os import time sys.path.append('./distributed-learning/') from utils.consensus_tcp import ConsensusMaster import consensus_trainer import consensus_master parser = argparse.ArgumentParser() parser.add_argument('--world-size', '-n', type=int, ...
materialized_views_test.py
import collections import re import sys import time import traceback import pytest import threading import logging from flaky import flaky from enum import Enum from queue import Empty from functools import partial from multiprocessing import Process, Queue from cassandra import ConsistencyLevel, InvalidRequest, Writ...
shutdn.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2022 Busana Apparel Group. All rights reserved. # # This product and it's source code is protected by patents, copyright laws and # international copyright treaties, as well as other intellectual property # laws and treaties. The product is licensed, not s...
monitor.py
""" Monitoring (memory usage, cpu/gpu utilization) tools. """ import os import time from math import ceil from ast import literal_eval from multiprocessing import Process, Manager, Queue import numpy as np import matplotlib.pyplot as plt try: import psutil except ImportError: pass try: import nvidia_smi ex...
sExprInterface.py
#!/usr/bin/python """ # Copyright (C) 2014-2015 Open Source Robotics Foundation # # 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 ...
PixelGraphing.py
try: y=0 import os import webbrowser from os import path, system import pyautogui import time from matplotlib import pyplot as plt import numpy as np from PIL import Image import sys import time from colorama import init, Fore, Back, Style import logging ...
server.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 use ...
cleanup.py
import tempfile import argparse import logging import datetime import threading import os import re from botocore.exceptions import ClientError from ocs_ci.framework import config from ocs_ci.ocs.constants import CLEANUP_YAML, TEMPLATE_CLEANUP_DIR from ocs_ci.utility.utils import get_openshift_installer, destroy_clus...
Manager.py
import logging import sys import threading from concurrent.futures.process import ProcessPoolExecutor from concurrent.futures.thread import ThreadPoolExecutor from rx import create, operators as ops from rx.subject import Subject from core.actorClasses.imageAnalyse import ImageAnalyseMock, ImageAnalyse from core.acto...
_reloader.py
import os import sys import time import subprocess import threading from itertools import chain from werkzeug._internal import _log from werkzeug._compat import PY2, iteritems, text_type def _iter_module_files(): """This iterates over all relevant Python files. It goes through all loaded files ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
hamster.py
import argparse import requests from requests.auth import HTTPBasicAuth from threading import Thread import time from colorama import init, Fore, Back, Style import pdb import urllib3 import ssl urllib3.disable_warnings() from multiprocessing import Process class File(): def __init__(self, fileName, mode): ...
test_threading.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 use ...
object-ident.py
import cv2 import time import os import pprint import re import numpy as np import pygame import queue import threading import signal import sys import ffmpeg pp = pprint.PrettyPrinter(indent=4) CONF_THRESH, NMS_THRESH = 0.9, 0.5 classNames = [] soundMeow = "/z/camera/Meow-cat-sound-effect.mp3" pygame.mi...
CO2Meter.py
import sys import fcntl import threading import weakref CO2METER_CO2 = 0x50 CO2METER_TEMP = 0x42 CO2METER_HUM = 0x44 HIDIOCSFEATURE_9 = 0xC0094806 def _co2_worker(weak_self): while True: self = weak_self() if self is None: break self._read_data() if not self._running: ...
uniPOIRelatedEdge.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # import sys import time import logging import getopt from multiprocessing import Process from util.UniPOIEdgeBasic import UniPOIEdgeBasic from util.UniAdmPOIEdge import UniAdmPOIEdge from util.dbopts import connectMongo def processTask(type, x, city, directory, inum, p...
test_wasyncore.py
import _thread as thread import contextlib import errno import functools import gc from io import BytesIO import os import re import select import socket import struct import sys import threading import time import unittest import warnings from waitress import compat, wasyncore as asyncore TIMEOUT = 3 HAS_UNIX_SOCKET...
alexa_audio.py
#!/usr/bin/env python3 import threading import math import struct import time import alexa_audio_device import logging from subprocess import Popen, PIPE, STDOUT from pocketsphinx import * DETECT_HYSTERESIS = 1.2 # level should fall lower that background noise DETECT_MIN_LENGTH_S = 2.5 # minimal length of...
wardriver.py
""" wardriver.py - Collects 802.11 Management Frame Tags/Parameters for analysis Author: Axel Persinger License: MIT License """ """ Imported Libraries argparse - Argument parser pymongo - MongoDB library threading - Threading library for console output time - Sleep tabulate - Pretty output tables scapy - Python Ne...
CursorTableModel.py
# # -*- coding: utf-8 -*- import math, random from pineboolib.flcontrols import ProjectClass from pineboolib import decorators from pineboolib.qsaglobals import ustr import pineboolib from PyQt4 import QtCore from pineboolib.fllegacy.FLSqlQuery import FLSqlQuery from pineboolib.fllegacy.FLFieldMetaData import FLFieldM...
packagemanager.py
"""Package manager for worlds available to download and use for Holodeck""" import json import os import shutil import sys import tempfile import urllib.request import urllib.error import fnmatch import zipfile import pprint from queue import Queue from threading import Thread from holodeck import util from holodeck.e...
crawler.py
#!/usr/bin/env python import certifi import google as google import requests import yaml import firebase_admin import hashlib import threading from googlesearch import search from firebase_admin import credentials from firebase_admin import firestore from datetime import datetime from urllib.parse import urlsplit ###...
keylogger.py
from pynput import keyboard from threading import Thread from requests import post from time import sleep from json import dumps url = "http://127.0.0.1:5000/" delay = 5 headers = { "Content-Type": "application/json", "User-Agent": "localtunnel" } keys = {} cle = "" de...
cms50e.py
import sys import threading import serial from time import sleep from blessings import Terminal SYNC = 0x80 PULSE = 0x40 OUTPUT = """ Heartrate:\t\t {} Oxygen saturation:\t {} Pulse waveform:\t\t {} Hit Ctrl+C to exit. """ class PulseOximeterReader(object): """ This class reads data from a Contec CMS50E p...
tool.py
#!/usr/bin/env python3 # -*- mode: python -*- # -*- 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 ...
Reinstall_oneclick_mac.py
#!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- """ Programmers : VBNIN - IPEchanges Python version : 2.7.16 This python app allows the user to reset its session with default settings loaded from the JAMF server Changelog : v0.1.1 : App creation v0.2.2 : App working for computer reset v0.3.1 : App mod...
server.py
import os import subprocess import shutil import queue import socket import struct import pickle import tempfile import threading import logging from select import select from os.path import dirname, basename from conduit_client import ssh PYTHON = shutil.which('python3') MODULE_PATH = dirname(dirname(__file__)) MOD...
training.py
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import threading try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K from .. import optimizers from .. imp...
ChatRoom1.0Server.py
#!/usr/bin/env python # -.- coding: utf-8 -.-y import threading import Queue import socket import time import sys import os from cmd import Cmd #Created by Camerin Figueroa cv = "1.0" q = Queue.Queue() q.put([]) errors = Queue.Queue() errors.put([]) motd = Queue.Queue() quit = Queue.Queue() quit.put("") mesg = Queue.Qu...
Rerequester.py
# Written by Bram Cohen # modified for multitracker operation by John Hoffman # see LICENSE.txt for license information from BitTornado.zurllib import urlopen from urllib import quote from btformats import check_peers from BitTornado.bencode import bdecode from threading import Thread, Lock from cStringIO imp...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
main.py
import os import atexit import threading from pathlib import Path from enum import Enum from json import dump, load from datetime import datetime from time import perf_counter from getpass import getpass from traceback import format_exc import jmc from jmc.exception import ( JMCDecodeJSONError, JMCFileNotFound...
lines_from_log.py
#!/usr/bin/python3 # file: C:\Work\Python\HID_Util\src\lines_from_log.py # usage: user must have the file Log_in_YAT_format.txt to retrieve line by line and send # commands with appropriate delay to the HID device from binascii import hexlify import sys import argparse import threading from time import per...
Server_gui.py
import socket import time from datetime import datetime import threading import tkinter from tkinter import Scrollbar, Text, Entry, Button, font from tkinter.constants import END, NS, VERTICAL import sys from threading import Thread, ThreadError from win10toast import ToastNotifier Notify = ToastNotifier() class S...
mp_workers.py
# # Simple example which uses a pool of workers to carry out some tasks. # # Notice that the results will probably not come out of the output # queue in the same in the same order as the corresponding tasks were # put on the input queue. If it is important to get the results back # in the original order then consider ...
simplequeue.py
import threading from multiprocessing import Process from . import runjob, jobid, store class Scheduler(object): def __init__(self): self._lock = threading.Lock() self._nextjob = threading.Event() self._jobs = [] self._pending = [] self._info = {} self._status = {} ...
engine.py
""" Main BZT classes Copyright 2015 BlazeMeter 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...
star_wars_2_threads.py
import threading from time import sleep from random import random def run(n): t = threading.current_thread() for count in range(n): print(f'Hello from {t.name}! ({count})') sleep(0.9 * random()) yoda = threading.Thread(target=run, name='Yoda', args=(4, )) vader = threading.Thread(target=run,...
local.py
"""Submission job for local jobs.""" # pylint: disable=invalid-name import sys import os import subprocess import logging from threading import Thread from . import tracker keepalive = """ nrep=0 rc=254 while [ $rc -ne 0 ]; do export DMLC_NUM_ATTEMPT=$nrep %s rc=$?; nrep=$((nrep+1)); done """ def ex...
middleware.py
import time import sys import traceback import requests import json import threading import logging import django from django.http import HttpResponse from django.utils.deprecation import MiddlewareMixin from django.conf import settings logger = logging.getLogger(__name__) logger.setLevel = logging.DEBUG #only loggin...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import hashlib import multiprocessing as mp import os import random import shutil import sys import tarfile import threading import time import warnings import zip...
nvidiaGpuMonPy.py
from tkinter import * from tkinter import messagebox from PIL import Image, ImageTk import tkinter as tk import psutil import pynvml import socket import threading import os # __MAIN__ def main(): # Dictionary for the border effects around the frames and labels border_effects = { ...